← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Vitest 5 Released with Performance Improvements, Trace View, and Stricter Defaults

🔄 Updated 3d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Vitest 5.0 improves performance by 8-53% across various setups.
  • New Trace View in Browser Mode records DOM snapshots for replay.
  • Stricter defaults for mocks and async assertions may break existing tests.
  • Requires Vite 6.4 and Node.js 22.12+; Yarn users must install Vite.

Performance Enhancements

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.

New Features and APIs

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.

Stricter Defaults and Breaking Changes

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.

Migration Requirements and Ecosystem Impact

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.

Vitest vs. Jest

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 →

The daily brief

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.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

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.