Skip to content

Infinite loop of screenshot creation on toMatchScreenshot failure #8959

@Romej

Description

@Romej

Describe the bug

Vitest starts creating reference screenshots in an infinite loop when my test fails.

Expected vitest to take a single screenshot on toMatchScreenshot failure.

Reproduction

https://github.com/Romej/vitest-browser-infinite-screenshots#

Image

System Info

System:
    OS: macOS 15.7
    CPU: (14) arm64 Apple M4 Pro
    Memory: 3.52 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.19.0
    npm: 10.9.3
    pnpm: 10.17.1

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

Labels

feat: browserIssues and PRs related to the browser runnerp2-edge-caseBug, but has workaround or limited in scope (priority)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions