-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: strip added indent in error inline snapshots #10217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you add a test as well? The test added in #8492 might serve as inspiration
@SimenB I've added tests - please check if you think it's appropriate! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just run prettier and it should be good to go 👍
I think I've fixed everything. |
Thanks! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Currently,
jest-snapshot
does not strip added white space characters when comparing inline snapshots for errors. Test will pass on the first run (when the snapshot is written), but will fail in any subsequent runs. This mainly only affects errors with multi-line messages.Test plan
Run this code (I'm happy to move this into a test case if required):
Before the change, the test fails.
It passes afterwards.