Vitest v5.1.2 - Release Notes & Engineering Impact
Component: vitest · Channel: stable. Automated analysis, not a compatibility certification. How this works.
Analysis updated: 2026-11-25.
Vitest v5.1.2 is a patch release delivering targeted bug fixes across browser testing, coverage, mocking, snapshots, and the UI, alongside three runtime performance optimizations. Teams benefit from more reliable error reporting, deduplicated coverage metrics, and faster source map handling, deep equality checks, and dynamic import discovery.
💻 Software Engineers & Devs
Upgrade if you rely on browser mode mocking or screenshots, snapshot retries, Bun worker pools, or want faster deep equality assertions and dynamic import mocking.
📊 Product & Engineering Leads
This maintenance patch introduces no new end-user capabilities, focusing instead on test runner stability and execution speed.
⚙️ DevOps & Security
CI pipelines may see marginal speedups from cached external source map reads, and any scripts passing `--changed` to `vitest related` should be checked since that flag combination is now disallowed.
⚡ Performance & Enhancements (3)
- Read external source maps once per run for improved performance
- expect: Reuse the key array during deep equality checks
- mocker: Find dynamic imports using es-module-lexer
🔧 Bug Fixes & Patches (12)
- Report global setup errors instead of displaying "no test files"
- Warn when multiple projects attach the same file
- browser: Avoid failing trace when a locator has no match for non-Playwright providers
- browser: Save failure screenshots per browser instance
- browser: Mock assets and computed dynamic imports
- cli: Disallow `--changed` in `vitest related`
- coverage: Prevent duplicate metrics caused by source map end column differences
- deps: Update all non-major dependencies
- mocker: Transform a factory-mocked module only once
- pool: Handle failed forks worker startup on Bun
- snapshot: Remove new snapshots created during a failed retry
- ui: Ensure `detailsPosition: bottom` for auto-opened trace view
❓ Frequently Asked Questions
Does Vitest v5.1.2 contain breaking changes?
The release notes do not explicitly document any breaking changes or required migrations, though missing breaking-change evidence does not guarantee complete compatibility; notably, the CLI now disallows `--changed` when running `vitest related`.
What is the primary highlight of v5.1.2?
The release combines stability fixes for browser mode, coverage deduplication, global setup error reporting, and snapshot retries with performance optimizations for external source maps, deep equality checks, and `es-module-lexer`-based dynamic import detection.
How should teams prepare to upgrade to v5.1.2?
Verify that no CI commands or npm scripts pass `--changed` to `vitest related`, then run your existing test suite after updating to confirm expected behavior across browser tests, coverage reports, and snapshot retries.