Skip to content
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

chore: do not escape strings in snapshots #12303

Merged
merged 3 commits into from
Feb 5, 2022

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Feb 5, 2022

Summary

Makes the snapshots easier to read (without requiring external jest-snapshot-serializer-raw)

Test plan

Green CI

@@ -9,7 +9,7 @@ exports[`should work without error 1`] = `

expect(received).toBe(expected) // Object.is equality

If it should pass with deep equality, replace \\"toBe\\" with \\"toStrictEqual\\"
If it should pass with deep equality, replace "toBe" with "toStrictEqual"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's an example where we didn't use jest-snapshot-serializer-raw and it's an improvement (unlike the places where we used it, which is now wrapped in ". IMO a bit uglier, but I think it makes sense to communicate it's a string)

@codecov-commenter
Copy link

Codecov Report

Merging #12303 (efbcfe2) into main (5f63582) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #12303      +/-   ##
==========================================
- Coverage   67.29%   67.29%   -0.01%     
==========================================
  Files         329      329              
  Lines       17336    17336              
  Branches     5074     5074              
==========================================
- Hits        11667    11666       -1     
- Misses       5637     5638       +1     
  Partials       32       32              
Impacted Files Coverage Δ
packages/expect/src/utils.ts 96.09% <0.00%> (-0.49%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f63582...efbcfe2. Read the comment docs.

@SimenB SimenB merged commit f2f578f into jestjs:main Feb 5, 2022
@SimenB SimenB deleted the do-not-escape-snapshot-strings branch February 5, 2022 17:27
@github-actions
Copy link

github-actions bot commented Mar 8, 2022

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants