Vitest, the Vite-native testing framework maintained by VoidZero, has released Vitest 4.1, delivering a collection of new features, and tooling enhancements aimed at making JavaScript testing more organized and closer to production.
Vitest 4.1 introduces several notable additions, including test tags for filtering and configuring groups of tests, an experimental mode to bypass Vite's module runner entirely, new lifecycle hooks, improved type inference in test fixtures, and a dedicated reporter for AI coding agents. The release also ships with full Vite 8 support from day one.
One of the standout features is test tags, inspired by Python's pytest markers. Tags allow developers to label tests and apply shared configuration such as timeouts or retries per tag. The feature was a requested addition, with a GitHub issue from October 2025 noting that "I come from Pytest, and simply marking tests is a feature I greatly miss in most test frameworks." The filtering syntax supports logical operators and wildcards, enabling patterns like vitest --tags-filter="frontend && !flaky" to run frontend tests while excluding unreliable ones.
Another significant addition is the experimental viteModuleRunner: false option, which disables Vite's module runner sandbox and runs tests using native Node.js import. No file transforms are applied, resulting in faster startup and closer-to-production behavior. For developers on Node.js 22.18+ or 23.6+, TypeScript is stripped natively with no extra configuration. A discussion on the Vitest GitHub confirmed the option also works with Bun but notes some missing features:
The only missing features I have noticed so far are:
- Module mocks - Easy to workaround using native mocks from
bun:testimport,- Coverage - Won't work until Bun exposes custom coverage API or adds support for V8 APIs (unlikely?)
The release introduces aroundEach and aroundAll hooks for wrapping tests in contexts such as database transactions or tracing spans, and a new test.extend builder pattern that supports type inference without manual type declarations.
For CI workflows, the built-in github-actions reporter now generates a Job Summary with test statistics and flaky test highlights. A new agent reporter reduces token usage when Vitest detects it is running inside an AI coding agent, suppressing output for passing tests and console logs.
A few GitHub issues were raised following the release, and have since been fixed, one reported that coverage ignore hints (v8 ignore if, v8 ignore next) stopped working in 4.1.0 unless the @preserve annotation was added, representing a regression from earlier versions. A separate issue flagged that the updated Vite peer dependency syntax broke installations for Yarn Classic (v1.x) users.
Compared to Jest, Vitest continues to widen the performance gap. A SitePoint benchmark of a 50,000-test production monorepo reported faster cold starts, faster watch mode re-runs, alongside lower peak memory usage. For teams considering migration, Vitest provides a migration guide covering the transition from both Jest and earlier Vitest versions, noting its API remains Jest-compatible by design.
Vitest is an open-source testing framework maintained by VoidZero. It builds on Vite to reuse the same configuration, resolve, and transform pipelines, making it a natural fit for Vite-based projects while also supporting standalone use with frameworks like React, Angular, Vue, and Node.js.