Migrating to Vitest v4.1.0-beta.4
Version v4.1.0-beta.4 introduces 1 breaking change. This guide details how to update your code.
Released: 2/16/2026
1
Breaking Changes
2
Migration Steps
12
Affected Symbols
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
test.extendtoTestSpecificationbeforeAllafterAllvitest listexpect.softVitestRunnerConfigSerializedConfigtoBe*toHaveBeen*toThrowErrordeepEqualBreaking Changes
●Issue #1
The configuration option for `deepEqual` in chai assertions is no longer allowed because it is not serializable.
✓Solution
Remove `deepEqual` usage from chai configuration options.
Migration Steps
- 1If you rely on `toBe*` spy assertions, migrate them to use `toHaveBeen*` or `toThrowError`.
- 2If you were using `deepEqual` in chai configuration, remove it as it is no longer supported due to serialization issues.
Release Summary
This release introduces support for Vite 8 beta, new features like type inference with `test.extend`, and improved stack trace handling. Several bug fixes address issues related to snapshots, configuration serialization, and runner behavior.
Need More Details?
View the full release notes and all changes for Vitest v4.1.0-beta.4.
View Full Changelog