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

Tests are duplicated after hitting "u" in watch mode to update snapshots #4986

Open
6 tasks done
jakebailey opened this issue Jan 16, 2024 · 2 comments
Open
6 tasks done

Comments

@jakebailey
Copy link

Describe the bug

In longer running tests with snapshots, I'm finding that watch mode duplicates the tests when snapshots are being updated. The tests themselves are not run more than once, but the view of the tests is itself duplicated. This happens regardless of the tests being concurrent or not.

Reproduction

Here's a github repo: https://github.com/jakebailey/vitest-watch-mode-bug

I've performed the steps listed in the readme in the below screencast:

vitewatchbug

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (20) x64 Intel(R) Core(TM) i9-10900K CPU @ 3.70GHz
    Memory: 42.11 GB / 47.05 GB
    Container: Yes
    Shell: 5.8.1 - /usr/bin/zsh
  Binaries:
    Node: 20.11.0 - /run/user/1000/fnm_multishells/2583630_1705436394438/bin/node
    Yarn: 1.22.21 - /run/user/1000/fnm_multishells/2583630_1705436394438/bin/yarn
    npm: 10.3.0 - /run/user/1000/fnm_multishells/2583630_1705436394438/bin/npm
    pnpm: 8.14.1 - /run/user/1000/fnm_multishells/2583630_1705436394438/bin/pnpm
    bun: 1.0.22 - ~/.local/bin/bun
  npmPackages:
    vitest: ^1.2.0 => 1.2.0

Used Package Manager

pnpm

Validations

@jakebailey jakebailey changed the title Tests are sometimes duplicated after hitting "u" in watch mode to update snapshots Tests are duplicated after hitting "u" in watch mode to update snapshots Jan 16, 2024
@AriPerkkio
Copy link
Member

Does this happen with vitest@1.1.0?
There were fixes to similar kind of issues in #4781 (comment).

@jakebailey
Copy link
Author

I checked, and it happens in v1.1.0.

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

No branches or pull requests

2 participants