[Feature]: Flag to fail when there are obsolete snapshot(s)
🚀 Feature Proposal
Add a CLI option (like --errorOnObsoleteSnapshots
) and a config option (like errorOnObsoleteSnapshots
) which will cause Jest to fail runs where there was one or more obsolete snapshots.
Motivation
The primary use case would be if one wanted to enforce in a CI that obsolete snapshots were not present. This would be useful for project hygiene, but also because if it were to occur unexpectedly, it might indicate an error has been introduced.
Example
No response
Pitch
Since it's a configuration for Jest itself, I don't see how else it could be reasonably implemented.