Last active
June 6, 2022 09:40
-
-
Save waliurjs/64939272faea076709d1a91a0af4e18e to your computer and use it in GitHub Desktop.
Jest snapshot update using interactive mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Update uncommitted changed testcases only: (replace 'jest' with 'yarn test' where applicable) | |
) jest --watch | |
) Press w when you have failing testcases | |
## update specific test file | |
) jest -u ./__tests__/link.test.js (include parent folders when running from inside of a 'workspace'. Same slash for Windows too.) | |
OR, | |
) jest --updateSnapshot ./__tests__/link.test.js | |
## Pick & choose failing testcases and update snapshots | |
) jest --watchAll | |
) If some tests are failing then following menu will be visible. Otherwise "Press 'w' to show more" | |
) Press i to update failing snapshots interactively. Following menu will appear: | |
) Press u to update failing snapshots for this test. | |
) Press s to skip the current test. | |
) Press q to quit Interactive Snapshot Mode. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment