wellworn
traps · 3 served

Vitest

vitest · latest 5.0.0 · MIT

Vite-native test runner with watch mode, browser mode, and a Jest-compatible expect API.

symptom and fix
major · >=5.0.0 · published · verified 2026-09-08
Vitest 5 refuses to start on Node 20, or on a project pinned to Vite 6.3 or older.
Vitest 5 requires Node.js 22 and Vite 6.4 as a minimum. Upgrade both before the runner, and note that `@vitest/runner` is now inlined and no longer published, so remove any direct dependency on it.
evidence
major · >=5.0.0 · published · verified 2026-09-08
A test that relied on mock call history from a previous test starts failing after upgrading to 5.
Vitest 5 clears mocks by default before each test. Set up the mock inside the test or a `beforeEach` rather than once at module scope, or set `clearMocks: false` if you truly want the old behaviour.
evidence
minor · >=5.0.0 · published · verified 2026-09-08
A test run in a monorepo package picks up no config and behaves as if options were ignored.
Vitest 5 no longer looks up a config file from ancestor directories. Give each package its own config, or pass `--config` explicitly from the workspace script.
evidence

Sorted by severity. Your agent sees the subset that matches the version you have installed: traps(library: "vitest", version: "5.0.0").