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

FR: workflow improvements when snapshot matching fails #574

Closed
gregveres opened this issue Apr 21, 2020 · 1 comment · Fixed by #674
Closed

FR: workflow improvements when snapshot matching fails #574

gregveres opened this issue Apr 21, 2020 · 1 comment · Fixed by #674

Comments

@gregveres
Copy link

I am really enjoying the extension. I have a couple of requests that I think will help the workflow when snapshots fail.
I notice that there is a Jest: ... section in the status bar and it shows when the tests are running. This is fantastic.

Here is my workflow when snapshots fail. It is a bit clunky. This is what happens now:

  • I make a change in my vue file and that triggers a unit test run
  • 20 seconds later a notification pops up saying that the snapshot is out of day (I use TS, hense the 20 second to run a test)
  • I click on the "Refresh snapshot" button
  • often a second notification will come up quickly with another refresh button. I am not sure if I am supposed to hit that or not
  • I sit there staring at the bottom of the screen for the notification that says snapshots have been updated.
  • I re-save my unit test file to trigger the test run again.

When each test run and snapshot generation takes 20 seconds (not your fault), this workflow becomes very time consuming. Here are some things I would love to see:

  • the status bar area: it would be nice if it showed when snapshot generation was occuring
    • there are times when I don't know if it is generating snapshots in the background
    • I also don't know if saving the unit test file again to kick off a new run will interfere with the snapshot generation or not
  • I assume that when I get multiple dialogs with the refresh button, that multiple test files have been run and have snapshot mismatches. It would be nice if the notification box told me which file was run and had failures.
  • It would be nice if there was some way to kick off snapshot update without having to wait for a failed test run first. Maybe beside the "view snapshot" button, there could be a "regenerate snapshot" button.

Thanks for listening

@connectdotz
Copy link
Collaborator

connectdotz commented Apr 28, 2020

@gregveres thanks for thinking about improving the extension. Great ideas 👍

A few points to help whoever interested in taking a shot at this:

the status bar area: it would be nice if it showed when snapshot generation was occuring

I was surprised that it didn't but after took a quick look it appeared that it is a bug on our side that we didn't pass the "reporters" flag for the updateSnapshot run, which is responsible to watch and report running state. see here

I assume that when I get multiple dialogs with the refresh button, that multiple test files have been run and have snapshot mismatches. It would be nice if the notification box told me which file was run and had failures.

here is where we detect snapshot error. It does very simple boolean check right now, if you can extract the test name from the message (it's there) it will be quite useful!

It would be nice if there was some way to kick off snapshot update without having to wait for a failed test run first. Maybe beside the "view snapshot" button, there could be a "regenerate snapshot" button.

that should also be easy to do once you see how we trigger the snapshot run above. But right now it will update for all tests, would be good to see if we can do the update for a specific test only, which you can consider expand SnapshotCodeLensProvider.

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

Successfully merging a pull request may close this issue.

2 participants