jest-image-snapshot icon indicating copy to clipboard operation
jest-image-snapshot copied to clipboard

Interactive Snapshot Mode

Open ThomasSimeroth opened this issue 6 years ago • 4 comments

In Jest 23, an interactive snapshot mode was added, allowing you to step through your failing JSON snapshots using -- -i in the command line. Unfortunately, that command is not implemented in this library. Is there any way to re-create that behavior in the library?

For instance, we could run the tests with npm test -- -i and if one of my tests fail, it would pause the test suite, and pop up the picture from the diff_output folder, thus showing the difference between the actual and the expected. Then the user could type u to update the screenshot, or s to skip that test, and not update the screenshot. On either decision, the pop-up would close, and the tests would resume.

This is clearly a nice-to-have feature, and would resolve issue #74 as well.

ThomasSimeroth avatar Jun 19 '18 21:06 ThomasSimeroth

Hmm that would be interesting. Not sure what the best UX would be for popping up a diff though but definitely something to think about. Tbh I have not used the snapshot interactive mode in jest 23 too much so I’ll have to use it a bit and figure out how to fit Jest-image-snapshot into it.

anescobar1991 avatar Jun 20 '18 03:06 anescobar1991

@anescobar1991 @ThomasSimeroth Indeed, Jest provides a great API to extend the interactive mode CLI, you can find the docs here: https://jestjs.io/docs/en/watch-plugins

amypellegrini avatar Oct 05 '18 14:10 amypellegrini

This issue is stale because it has been open 30 days with no activity. Remove no-issue-activity label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 07 '20 00:04 github-actions[bot]

This issue is stale because it has been open 30 days with no activity.

github-actions[bot] avatar May 08 '20 00:05 github-actions[bot]