-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Interactive Snapshot Update Mode outside of watch mode #8135
Comments
Unrelated to your feature proposal, but this surprises me. Running tests once in watch mode should in general not be slower than running the same set of tests outside of watch mode. Is there an open issue for this performance problem or could you perhaps create a repo that reproduces this on a smaller scale? |
Ow, that one's bad. Unfortunately it's not magically resolved by the micromatch fix and it's going to be way harder to profile than the micromatch thing :/ |
I like the idea of this, I'm not sure how feasible it is if you want to avoid watch mode, though. The whole interactiveness is quite tied to watch mode |
|
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Make the interactive snapshot update mode available without requiring to use watch mode.
Add a new cli option
--updateSnapshotInteractive
that runs all tests and lets the user decide for each failing snapshot test whatever the snapshot should be updated.Motivation
Jest Snapshots are an amazing feature with the main downside that users can tend to blindly update all failing snapshot tests without reviewing the changes (because it's that easy :)). This issue has been addressed by introducing interactive snapshot updates in watch mode.
Unfortunately, watch mode is considerably slower than the normal run mode resulting in long initial run times (+30minutes) when making changes to a file with many dependents (requiring a lot of tests to rerun) in a large repository (+1000 test suites). Users are, thereby, faster by updating all snapshots and reviewing the changes in the VCS diff (and reverting undesired updates). This has the downside that a user might miss an update or not reviewing the changes at all. Furthermore, reverting undesired snapshot requires manual work.
Example
I'm not sure if Jest should first run all tests or showing the user the diffs as soon as a snapshot has failed (allows running the other tests in the background)
Pitch
Snapshots are a core functionality of Jest. The flow for updating snapshot should, thereby, be a core functionality as well. Furthermore, interactive snapshot updates are already part of jest core in watch mode.
The text was updated successfully, but these errors were encountered: