use raw serializer for e2e output snapshots#7651
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7651 +/- ##
=======================================
Coverage 68.23% 68.23%
=======================================
Files 251 251
Lines 9639 9639
Branches 5 6 +1
=======================================
Hits 6577 6577
Misses 3060 3060
Partials 2 2Continue to review full report at Codecov.
|
|
Wow, this looks like a huge DX improvement to me. |
|
I had that at the start, but we do quite a lot of Adding a property doesn't work, as |
Implement String methods ourselves? :D Just kidding, if there's no simple way to automate it then it's probably not worth it as the extra effort required in each test seems manageable. |
For sure, I agree! Personally, I'd like some option in Jest that does not escape strings in snapshots (beyond what must be escaped in a template string for it to still be valid JS) |
…m-runtime * upstream/master: add missing truncate comment to recent blog posts (jestjs#7655) use raw serializer for e2e output snapshots (jestjs#7651) chore: use a Set for reserved words list in `jest-mock` Fix automock for numeric function names (jestjs#7653) Update docs re: `moduleFileExtensions` to add ordering note (left-to-right) (jestjs#7616)
|
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
Noticed we had some inconsistencies in newlines on CI. Added a
trim, but that looked pretty bad due to the"all over.So I've added
jest-snapshot-serializer-raw, which really cleans up the snapshots, IMO (should probably be default behavior in Jest... (#5660)).An advantage is that now the snapshots actually match what the user sees, as we get rid of a lot of escaping
Test plan
Updated a lot of snapshots, hopefully green CI