https://github.com/jakebailey/vitest-watch-mode-bug
https://github.com/jakebailey/vitest-watch-mode-bug
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jakebailey/vitest-watch-mode-bug
- Owner: jakebailey
- License: mit
- Created: 2024-01-16T20:34:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T20:38:16.000Z (over 2 years ago)
- Last Synced: 2025-11-12T22:31:53.754Z (7 months ago)
- Language: TypeScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vitest-watch-mode-bug
1. `pnpm install`
1. `pnpm test`; watch mode will start
1. Edit `index.test.ts` (e.g., replace `expect(t)` with `expect(t+1)`).
1. Watch mode will re-run the test and fail, as expected.
1. Hit `u` to update the baseline, but the progress will show all tests doubled, like:
```
RERUN update snapshot
❯ index.test.ts (10)
✓ test 0 503ms
✓ test 1 504ms
✓ test 2 504ms
✓ test 3 504ms
✓ test 4 505ms
⠦ test 5
⠦ test 6
⠦ test 7
⠦ test 8
⠦ test 9
❯ index.test.ts (10)
✓ test 0 503ms
✓ test 1 504ms
✓ test 2 504ms
✓ test 3 504ms
✓ test 4 505ms
⠴ test 5
⠴ test 6
⠴ test 7
⠴ test 8
⠴ test 9
```
Then at the final screen, doubled again:
```
RERUN update snapshot
✓ index.test.ts (10) 1007ms
✓ index.test.ts (10) 1007ms
Snapshots 60 updated
Test Files 1 passed (1)
Tests 10 passed (10)
Start at 12:36:47
Duration 1.01s
PASS Waiting for file changes...
press h to show help, press q to quit
```
1. Hit `r`, and the duplication goes away.