Migrating to Vitest v4.0.0-beta.6
Version v4.0.0-beta.6 introduces 2 breaking changes. This guide details how to update your code.
Released: 8/4/2025
2
Breaking Changes
3
Migration Steps
5
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
vi.spyOnReporter APIconfig.includeconfig.browser.instances[].includerolldown-vite bundler configurationBreaking Changes
●Issue #1
Spying implementation was rewritten, causing existing mocks that relied on the previous behavior to break. Update mocks to use the new spying API as described in the updated documentation.
●Issue #2
Reporter deprecated APIs were removed. Refactor any custom reporters or configuration that used the old APIs to the new reporter interface.
Migration Steps
- 1Review and adjust any spying code to align with the new implementation; refer to the migration guide for the updated API.
- 2Remove usage of removed reporter APIs and update custom reporters to the current reporter interface.
- 3If you rely on `config.include`, ensure it is not unintentionally overridden by `config.browser.instances[].include`, or adjust the configuration accordingly.
Release Summary
Vitest v4.0.0-beta.6 introduces a rewritten spying system and removes deprecated reporter APIs, along with several bug fixes and dependency updates.
Need More Details?
View the full release notes and all changes for Vitest v4.0.0-beta.6.
View Full Changelog