-
|
I have noticed that sometimes when removing code and their corresponding tests, the developer forgets to delete snapshots from snapshot files. Since Vitest only gives a warning about it, the developer might not notice it, and the snapshots only get removed when the next developer in another PR updates snapshots. This small annoyance could be fixed if there was a setting that marks the test run as failed if obsolete test snapshots are found. I did not find anything about this in the docs or Github, so I am assuming there is no support for this yet. If that is the case, feel free to convert this to an "Idea" type of discussion. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Hmm, I thought that's already the default CI behavior similar to how creating new snapshot is not allowed on CI. |
Beta Was this translation helpful? Give feedback.
This is what I meant. I said CI but internally there's a
updateSnapshot: "none"flag and that forces empty snapshot to fail (which is snapshot creation otherwise). We can do the same and let obsolete snapshot to fail (which is currently terminal logging only) and make that behavior as default on CI. Please feel free to open an issue so we can discuss this further and not forget 🙏