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

How to update outdated snapshots or generate new ones? #368

Open
otbe opened this issue Aug 25, 2018 · 4 comments
Open

How to update outdated snapshots or generate new ones? #368

otbe opened this issue Aug 25, 2018 · 4 comments

Comments

@otbe
Copy link

otbe commented Aug 25, 2018

Environment

node -v: v9.11.2
npm -v: 5.6.0
npm ls jest: jest@23.5.0
Operating system: OSX 10.13.6
VSCode: 1.27.0

Prerequisite

  • are you able to run jest test from command line? Yes
  • how do yo run your tests from command line? jest

Expected Behavior

Im able to update or create new snapshots by the proposed "A one button update for failed snapshots." feature.

Actual Behavior

Where? :)

In case of failed snapshots I expected a dropdown or inline link to update the snapshot but nothing is there:
bildschirmfoto 2018-08-25 um 14 15 31

In case of a new snapshot could be written, there is a "snapshot missing" text above the expect clause. If I clickthe link it triggers the popup in right bottom corner, but nothing happens.
bildschirmfoto 2018-08-25 um 14 26 58
bildschirmfoto 2018-08-25 um 14 27 08

Whats wrong with my attempt?

Thank you!

@jaripekkala
Copy link

Related #276

@randycoulman
Copy link

I'm seeing this issue as well. I tried digging into it a bit, but couldn't figure out how to find the source for the extension within the VS Code dev tools so I could set a breakpoint.

It seems like this line is relevant and wouldn't match the case where more than 1 snapshot fails, but even with only one failing or missing snapshot, I'm still not seeing the prompt even though my test output seems to match the pattern on that line.

If anyone can let me know how I can actually debug this within VS Code, I'm happy to give it a shot. I haven't worked on VS Code extensions before, so it is likely that no advice you can give me is too simple or obvious :-). Do I need to clone and compile locally in order to debug it, or is there a way I can do it with the released version of the extension?

@randycoulman
Copy link

This seems to have been fixed by #356, but there hasn't been a release with that PR included yet.

@Eidher
Copy link

Eidher commented Apr 11, 2019

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:
#215

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants