How to use test filters without triggering "obsolete snapshot" #7106
Answered
by
hi-ogawa
jasonkuhrt
asked this question in
Q&A
-
Hey, when running a command like:
The targeted test runs but then all other tests are considered obsolete.
The major usability problem here is that while filtering I cannot update the failing snapshot without causing the others to be deleted, but if I don't filter I have many more tests that are slow etc. Am I missing something? |
Beta Was this translation helpful? Give feedback.
Answered by
hi-ogawa
Dec 21, 2024
Replies: 1 comment 5 replies
-
Can you provide a repro? I don't think this should happen with a simple |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I thought this is a limitation since we cannot track what's the snapshot untiltoMatchSnapshot("my-name")
, but I think we can probably apply a same heuristics as how we handletoMatchSnapshot()
which uses auto-icremented number.(EDIT: oh wait,
toMatchSnapshot()
actually has the same behavior... 😢)https://stackblitz.com/edit/vitest-dev-vitest-mitcgkkj?file=test%2F__snapshots__%2Fbasic.test.ts.snap