-
-
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
Explain which snapshots are obsolete #5005
Comments
Yeah, I like it. Are you willing to work on a pull request for this? :) You can look in the code for "obsolete snapshot" and it will probably point you to the right place. |
Hey, I tried to solve this, but unfortunately the reporter is only given a export type SnapshotSummary = {
added: number,
didUpdate: boolean,
failure: boolean,
filesAdded: number,
filesRemoved: number,
filesUnmatched: number,
filesUpdated: number,
matched: number,
total: number,
unchecked: number,
unmatched: number,
updated: number,
}; This summary does not include the name of removed/obsolete snapshots, so they would need to be added higher in the chain... I don't have much time for that... |
Man this would be great... I could try and look into it but I'd need some guidance on where the filenames could be added |
This is fixed, isn't it? See #5020 |
May this have regressed recently? When updating, no file on my fs would actually change; so I had no idea what was wrong. The CI kept asking me to update snapshots, but when I did, no files would change. I found out which file jest was 'complaining' about by hacking into the TestScheduler. The file jest considered 'obsolete' was a snapshot that got copied into my Or is this a different usecase from the issue above? I also looked at the json output from jest. But the reporter only gets the count of 'deleted' files:
I wonder why jest considers this file "deleted". |
Hmm, perhaps. From a cursory look at the linked PR we only check for individual snapshots within a file, but in your case a whole file is obsolete. We should probably include the filename in that case. Would you mind opening up a new issue with a reproduction? I'd guess just adding a dummy snapshot file should reproduce? |
@SimenB yes, I'd love to help out fix this, would you be able to assist me in effectively getting up to speed so i can open a PR? |
For sure! If you can put together a small reproduction I can verify my theory (or dig some more) so I can provide proper guidance 🙂 |
Thank you! We can pair on it if you'd like? |
Snapshot Summary |
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. |
When jest finds obsolete snapshots, it does not explain which one they are. This can be very frustrating, when you have many snapshots and you can't find which one is wrong...
The problem was also shortly discussed in #3581
Jest output:
I expect an output more like:
This is a problem for me because when I run tests locally, no snapshot are obsolete, but when run in my CI/CD, it finds 2 obsolete snapshots, without telling me which ones....
The text was updated successfully, but these errors were encountered: