BlockEdge

Technology and digital life

Vitest 5.0 prioritizes speed and tightens test defaults

As reported on November 17, 2026, VoidZero had released Vitest 5.0, an update to the Vite-based test runner focused on performance and stricter test behavior.

In benchmarks spanning projects from a five-file utility package to a 1,280-module application, the Vitest team reported speed gains of roughly 8%–25% in most configurations and up to 53% with VM pools. VoidZero said on X that overall performance, including browser mode, improved by about 18%. The reported gains come from changes including inline projects sharing one Vite server, a stable disk-based fsModuleCache, fewer round trips between the main process and workers, and reusable compiled code in VM pools. A new vitest doctor command reruns a test suite under different configurations and recommends faster options.

Browser mode adds Trace View, which records interactions and assertions as DOM snapshots for step-by-step replay. The new vi.when API lets one spy return different values for different arguments.

Several defaults and checks may affect existing suites. clearMocks now defaults to true; asynchronous assertions without await fail instead of producing a warning; hoisted vi.mock calls outside top-level scope throw an error; and toThrow('') now matches any error. OpenReplay, an independent analysis site, said most of these changes expose tests that were already incorrect. It cautioned that suites relying on mock history leaking between tests—particularly call-count assertions—could fail in CI despite having passed locally on Vitest 4.

Vitest 5 requires Vite 6.4 and Node.js 22.12 or later. Yarn users must install Vite themselves because it is now a peer dependency. Reports, attachments and blob reports have moved to .vitest/, so CI artifact paths may need updating. Ecosystem compatibility was still in progress at the time of reporting: an issue concerning Cloudflare’s vitest-pool-workers said its peer-dependency range was pinned to Vitest 4, potentially preventing projects using Vitest 5 from running tests.