-
-
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 issue with nested sibling describe blocks #6625
Comments
This behaviour was introduced in 23.0.0 Before that (v22.4.2) the behaviour was to group all 3 snapshots in the linked example repo together (and therefore update them together). I'm not suggesting that behaviour was more desirable than the intended improvements in v23, just noting that's what changed when this issue was introduced. |
Probably broken by #6579 |
@rickhanlonii Sorry I should have made it more clear: this issue also exists in 23.0.0, so I don't think it's directly related to #6579. |
Ah, ok thanks 👍 |
This issue seems to be fixed in the latest version (23.4.0), no issues with "obsolete" snapshots any more. However the overall process is a little slow if there are more than a couple of snapshots to go through, which seems to be due to reinitializing(?) the suite for each snapshot. Is this intended? |
I'll close this as I think the last point about the slowness is just a consequence of design, and it's not strictly related to the original issue. |
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. |
Following on from #6611, #6485 and the fix for that issue in #6579.Probably not directly related to that issue.🐛 Bug Report
Minimal example structure:
describe
describe
test
containing.toMatchSnapshot()
describe
test
containing.toMatchSnapshot()
When entering interactive snapshot update mode in Jest 23.3.0, the prompt for the first failed snapshot says that all the other snapshots (for other tests) are "obsolete" and that they will be removed. Example output from my actual project:
Upon pressing
u
that's what happens: the one snapshot gets updated but the rest get deleted (including two that passed). Then when it moves onto the next failing snapshot, it says that no previous snapshot exists (since it was just deleted) and that the the one that was just updated is obsolete. Pressingu
again does more or less the same thing: the current snapshot gets written, and the one that was updated just before is deleted. In effect it's only allowing allowing the storage of a single snapshot when going through interactive mode.Doing a standard snapshot update with
u
/-u
works as expected, it writes all the snapshots.Link to repl or repo (highly encouraged)
https://github.com/noinkling/jest-bug-repro
With Jest 23.0.0 - 23.3.0 (can
npm install
), runnpm test
orjest --watchAll
directly, then pressi
to enter interactive mode.Run
npx envinfo --preset jest
I'm using WSL.
The text was updated successfully, but these errors were encountered: