Vscode-jest: Update failing snapshots [HOW TO]

Created on 28 Feb 2018  Â·  11Comments  Â·  Source: jest-community/vscode-jest

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

documentation help wanted ready for work

Most helpful comment

I'm also experiencing this absence of the "dropdown to update snapshots in the editor".

I used to see it, but now it no longer displays. Is this a known issue?

image

Above: I get "New snapshot is ready to write", but no means within VSCode of writing it.

All 11 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?

I'm also experiencing this absence of the "dropdown to update snapshots in the editor".

I used to see it, but now it no longer displays. Is this a known issue?

image

Above: I get "New snapshot is ready to write", but no means within VSCode of writing it.

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.

Screen Shot 2019-04-11 at 12 38 51 AM

Here's an extended explanation:
https://github.com/jest-community/vscode-jest/pull/215

Snapshot update should use onlyChanged flag, this will only run required test.

otherwise it will run all tests, which could need a huge amount of time

I'm also sometimes gets:
Screen Shot 2019-09-08 at 13 41 45
Without the "update snapshot" prompt.

how do i update my snapshot?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Drakota picture Drakota  Â·  16Comments

bnwan picture bnwan  Â·  28Comments

dandv picture dandv  Â·  17Comments

qwerty2k picture qwerty2k  Â·  26Comments

connectdotz picture connectdotz  Â·  37Comments