-
Notifications
You must be signed in to change notification settings - Fork 294
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
Update failing snapshots [HOW TO] #276
Comments
There is a dropdown to update snapshots in the editor when that text is detected. |
Could you submit a PR with the docs you'd like to see @albert-olive? |
@seanpoulter I'd gladly submit the PR with the docs if @orta can direct me to the dropdown. I don't see a dropdown anywhere and it doesn't update on save of the test or file that caused the need for snapshot update. |
There is/used to be a notification that asks if you want to replace them in the editor |
I see it occasionally but not necessarily when I need it to. I can comment out an expect. Save. Uncomment the expect and it will then prompt me. But is there a way to update without depending on the prompt? |
This seems to have been fixed in #356, but there hasn't been a release with that fix in it yet. |
On release 2.9.2 there's an option to Restart Jest On Snapshot Update, this worked for me. Here's an extended explanation: |
Snapshot update should use otherwise it will run all tests, which could need a huge amount of time |
how do i update my snapshot? |
It looks like that's implemented by the regex here: vscode-jest/src/JestExt/process-listeners.ts Line 141 in 4f7359a
However, the text it's looking for seems to only get printed in certain cases, based on some random criteria in jest (e.g this issue suggests you have to run >20 tests: jestjs/jest#3322) So I think all the people complaining in this thread about no update snapshot prompt are running into the issue where jest is not printing that summary out. |
Hi, I don't find any documentation so that's why I'm asking this question:
How do I update failing snapshots? I see that message but I don't know were to press u.
› 2 snapshot tests failed in 1 test suite. Inspect your code changes or press
u
to update them.Thanks
The text was updated successfully, but these errors were encountered: