Migrating to Vitest v5.0.0-beta.5
Version v5.0.0-beta.5 introduces 6 breaking changes. This guide details how to update your code.
Released: 6/15/2026
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
TestModule diagnosticshappy-dom/jsdom window objectcoverage.thresholds.perFileorchestrator html requestvi.mock()Breaking Changes
●Issue #1
Configuration file lookup no longer searches ancestor directories.
●Issue #2
The `@vitest/runner` package has been inlined; it will no longer be published separately.
●Issue #3
It is now allowed to mutate the happy-dom/jsdom window object.
●Issue #4
The `concurrencyId` and `workerId` exposed on TestModule's diagnostics are now 1-based.
●Issue #5
Browser mode now requires a `sessionId` for orchestrator HTML requests.
●Issue #6
The `coverage.thresholds.perFile` configuration now accepts an object (previously it might have been implicitly expecting a different structure).
Migration Steps
- 1If you relied on ancestor directories for configuration lookup, ensure your config file is located in the expected project root.
- 2If you were importing from `@vitest/runner` directly, remove that dependency as it is now inlined.
- 3Review code that mutates the happy-dom/jsdom window object, as this behavior is now explicitly allowed and might require updates if previous behavior was relied upon.
- 4If consuming `TestModule` diagnostics, be aware that `concurrencyId` and `workerId` are now 1-based.
- 5Browser tests requiring orchestrator HTML requests must now supply a `sessionId`.
- 6Review `coverage.thresholds.perFile` configuration if you were using it, as it now accepts an object structure.
Release Summary
This release introduces several breaking changes, including changes to configuration lookup and diagnostic IDs, alongside new features like the `--repeats` CLI option and UI improvements for browser testing. Numerous bug fixes address issues across browser, coverage, and mocking functionality.
Need More Details?
View the full release notes and all changes for Vitest v5.0.0-beta.5.
View Full Changelog