Skip to content
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

Vitest: Incorrect filename when running concurrently #356

Open
HalfdanJ opened this issue Aug 2, 2024 · 1 comment
Open

Vitest: Incorrect filename when running concurrently #356

HalfdanJ opened this issue Aug 2, 2024 · 1 comment

Comments

@HalfdanJ
Copy link

HalfdanJ commented Aug 2, 2024

When using jest-image-snapshots in vitest, the naming of the snapshot files are incorrect when a test suite is run concurrently (describe.concurrent().

Instead of getting the name of each test, it instead gets the name of the last test in the suite, appended with an index, and the order depends on which tests finish first.

I'm unsure if this is a vitest issue or jest-image-snapshot issue.

@vinnymac
Copy link

This is likely related to #181.

I am experiencing a similar issue with test.concurrent.for where the tests fail on the second run every time. test.for does not behave this way. If I replace toMatchImageSnapshot with toMatchSnapshot it also works without issue.

This leads me to believe that the global state referenced in #181 means this library does not currently support concurrent testing. While it'd be nice if the README mentioned this, ideally this would get fixed internally, perhaps to match the behavior of toMatchSnapshot. AsyncLocalStorage may be one solution for example 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants