-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Labels
Description
Describe the bug
If I set browser.screenshotDirectory and run my tests, I get:
FAIL visual (chromium) tests/routes/(home)/visual.test.ts > Landing page (visuals) > ..looks like before
Error: expect(element).toMatchScreenshot()
No existing reference screenshot found; a new one was created. Review it before running tests again.
Reference screenshot:
/home/ubuntu/website.1/tests/routes/(home)/home/ubuntu/website.1/__shots__/visual.test.ts/home-chromium-linux.png
Failure screenshot:
- __shots__/tests/routes/(home)/visual.test.ts/Landing-page--visuals----looks-like-before-1.png
While the "Failure screenshot" path is as expected, the "Reference screenshot" path is strange.
Expectation:
- only one folder to be named (
__shots__/tests/routes/[...])
Actual:
- a second, strange path gets created
vitest 4.0.17, 4.0.18
Reproduction
Sorry no MVR at this hour.. Going on a trip and wanted at least to share this, in hopes a fix might land by 4.1.
System Info
System:
OS: Linux 6.8 Ubuntu 24.04.3 LTS 24.04.3 LTS (Noble Numbat)
CPU: (2) x64 06/9e
Memory: 2.53 GB / 3.82 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 24.13.0 - /usr/bin/node
npm: 11.6.2 - /usr/bin/npm
npmPackages:
@vitest/browser-playwright: ^4.0.18 => 4.0.18
@vitest/ui: ^4.0.15 => 4.0.18
playwright: ^1.58.0 => 1.58.2
vite: 8.0.0-beta.13 => 8.0.0-beta.13
vitest: ^4.0.18 => 4.0.18
vitest-browser-svelte: ^2.0.2 => 2.0.2Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Reactions are currently unavailable