Migrating to Vitest v4.0.0-beta.11
Version v4.0.0-beta.11 introduces 4 breaking changes. This guide details how to update your code.
Released: 9/11/2025
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
verboseReportertreeReporterprettyFormatexpectexpect.extendasymmetricMatcherprojectstest.eachtest.forEach$ formatting% formattingwildcard export pattern ("./*")browser build entryspy.respyBreaking Changes
●Issue #1
Verbose reporter now prints tests as a list and a new `tree` reporter is introduced; scripts that parsed the old verbose output must be updated to handle the list format or switch to the `tree` reporter.
●Issue #2
Shadow root contents are now included in `pretty-format` output; tests that asserted on formatted output need to adjust expectations or filter out shadow‑root nodes.
●Issue #3
`expect` now forwards the current equality testers to asymmetric matchers; custom asymmetric matcher implementations must accept the additional tester argument or update their logic.
●Issue #4
`projects` detection is limited to files named `vitest.config.*` or `vite.config.*`; any project using differently named config files must rename them to match the new pattern.
Migration Steps
- 1If you rely on the old verbose reporter output, modify your parsing logic to handle the new list format or configure Vitest to use the `tree` reporter instead.
- 2Update any assertions that compare `pretty-format` strings to account for the newly included shadow‑root content.
- 3Revise custom asymmetric matcher implementations to accept the equality tester argument passed by `expect`.
- 4Rename configuration files to `vitest.config.*` or `vite.config.*` so that Vitest can discover them under the new project detection rules.
Release Summary
Vitest v4.0.0‑beta.11 adds a new tree reporter, includes shadow‑root content in snapshots, updates the expect API, tightens project config discovery, and brings several UI enhancements and bug fixes.
Need More Details?
View the full release notes and all changes for Vitest v4.0.0-beta.11.
View Full Changelog