Vitest 5: Prioritises Performance with a Shared Vite Server, Trace View, and Stricter Test Defaults
Vitest 5.0 focuses on speed, with reported gains of 8 to 25 percent in most setups and up to 53 percent in VM pools. It adds a vitest doctor command, Browser Mode Trace View, and vi.when. Defaults are stricter: clearMocks is true and unawaited async assertions fail. It requires Vite 6.4 and Node.js

Using a purpose-built benchmark suite that spans everything from a five-file utility package to a 1,280-module monolith, the team reports gains of roughly 8 to 25 percent across most setups, rising to 53 percent in VM pool scenarios. VoidZero summarised the release on X as "vm pools up to 53% faster, ~18% boost across the board including Browser Mode". The wins come from inline projects sharing a single Vite server, a stabilised on-disk fsModuleCache, fewer round trips between the main process and workers, and VM pools that reuse compiled code. A new vitest doctor command reruns a suite under alternative configurations and recommends faster options.
Browser Mode also gains a built-in Trace View that records each interaction and assertion as a DOM snapshot for step-by-step replay, while the new vi.when API lets a single spy return different values per argument.
clearMocks now defaults to true, unawaited async assertions fail rather than warn, hoisted vi.mock calls placed outside the top level now throw, and toThrow('') matches any error. As the independent OpenReplay breakdown puts it, most of these changes simply "break test code that was already wrong", but the dangerous ones are suites that pass locally on Vitest 4 and "go red in CI with an error that says nothing about why", usually call-count assertions that relied on mock history leaking between tests.
Vitest 5 requires Vite 6.4 and Node.js 22.12 or newer, and Yarn users must now install vite themselves because it became a peer dependency. The migration guide and v5.0.0 changelog document each change, and reporter output, attachments, and blob reports now live under one.vitest/ directory, so CI artifact paths need updating. Ecosystem catch-up is ongoing: Cloudflare's vitest-pool-workers issue notes its peer range pinned to v4 means any project pulling the new release "fails before a single test runs".
Against Jest, a recent head-to-head comparison scores Vitest ahead on performance and future-proofing yet behind on ecosystem and community, reflecting Jest's far larger install base and first-class React Native support. The advice to anyone considering the choice is unchanged, reach for Vitest on Vite, Nuxt, or greenfield projects, leave large working Jest suites in place, and let the two coexist in a monorepo.
Vitest is an open-source, Vite-powered test runner developed by VoidZero, the company founded by Vite creator Evan You that has joined Cloudflare. It reuses a project's existing Vite configuration to run unit, component, and browser tests with native ESM and TypeScript support, and is backed by more than 790 contributors.
Explore how Azul helps Java teams reduce JVM vulnerability risk, strengthen application security, and prepare their Java environments for agentic AI. Discover practical strategies for securing Java workloads while maintaining performance and reliability. Learn more.