This repository reproduces an intermittent bug in Vitest browser mode where tests randomly fail in CI with:
Error: Vitest failed to find the current suite. This is a bug in Vitest.
- Fork this repository
- Push a commit to trigger CI
- Observe that some test runs may fail with the error above
- Re-run the failed job - it will likely pass
- Vitest: 4.0.8
- @vitest/browser: 4.0.8
- Playwright: latest
- Node: 20.x
- OS: Ubuntu (GitHub Actions)
- ✅ Tests pass locally
- ❌ Tests randomly fail in CI (approximately 1 in 5 runs)
- ✅ Re-running CI fixes the issue
The workflow runs tests 5 times in parallel to increase the likelihood of reproducing the race condition.