Vitest 5.0 prioritizes speed, reporting performance gains of approximately 8% to 25% across most configurations, with up to a 53% increase in VM pool scenarios. These improvements stem from inline projects sharing a single Vite server, a stabilized on-disk `fsModuleCache`, reduced main process-worker round trips, and VM pools reusing compiled code. A new `vitest doctor` command helps identify and recommend faster test configurations.
Browser Mode now includes a built-in Trace View, which captures DOM snapshots for each interaction and assertion, allowing for step-by-step replay of test execution. Additionally, the new `vi.when` API enables a single spy to return different values based on the arguments it receives.
Several long-standing defaults have been tightened in Vitest 5.0. `clearMocks` now defaults to `true`, unawaited async assertions will fail instead of warn, hoisted `vi.mock` calls outside the top level now throw errors, and `toThrow('')` matches any error. These changes are intended to correct previously incorrect test code, though some suites passing in Vitest 4 may fail in Vitest 5 due to issues like mock history leaking between tests.
Vitest 5 requires Vite 6.4 and Node.js 22.12 or newer. Yarn users must now install Vite as it has become a peer dependency. The `.vitest/` directory now centralizes reporter output, attachments, and blob reports, necessitating updates to CI artifact paths. Ecosystem components, such as Cloudflare's `vitest-pool-workers`, may require updates to support the new version.
In comparisons, Vitest generally leads Jest in performance and future-proofing, while Jest maintains an advantage in ecosystem size and community support, particularly with React Native. The recommendation remains to use Vitest for Vite, Nuxt, or new projects, and to retain existing large Jest suites.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Vitest 5.0 has been released, focusing on performance gains of 8% to 53% through a shared Vite server, improved caching, and optimized worker communication. The update also introduces a built-in Trace View for Browser Mode, a new `vi.when` API, and stricter default behaviors for assertions and mocks. This release requires Vite 6.4 and Node.js 22.12 or newer, and may require updates to existing test suites and CI configurations.