[Vitest 2.x] Browser mode failure snapshots directory name can conflict with other tools #6239
Closed
6 tasks done
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
Describe the bug
When testing story files from Storybook using Vitest (e.g.
Button.stories.tsx
), the failures generate a directory like__screenshots__/Button.stories.tsx/FailingStoryName.png
:However because the Storybook indexer uses globs that match
*.stories.*
, it ends up detecting the directory too.While Storybook could improve its matching mechanics, being able to modify the names used in the snapshots like Jest's
snapshotResolver
would be quite useful. There could be other tools which might conflict because of similar situations.If Vitest appended
.snap
at the end of the directory name, this would also fix the issue.Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: