Migrating to Vitest v4.0.0-beta.5
Version v4.0.0-beta.5 introduces 2 breaking changes. This guide details how to update your code.
Released: 7/28/2025
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
module-runnervite-noderunnertestdescribeBreaking Changes
●Issue #1
The test runner now uses the module-runner package instead of vite-node. Update any custom integrations or scripts that import or depend on vite-node to use module-runner instead.
●Issue #2
The runner now automatically sets its mode to `todo` when no function is passed to `test` or `describe`. Adjust any code that relied on the previous default mode to handle the new `todo` mode.
Migration Steps
- 1Replace imports of `vite-node` with `module-runner` in your project configuration and scripts.
- 2If you have custom runner logic that assumes a specific mode, add explicit mode handling because the runner will default to `todo` when no test function is provided.
- 3Run your test suite after the changes to verify that shadow root selectors work correctly in wdio environments.
Release Summary
This beta release switches the test runner to module-runner, adds automatic `todo` mode for empty tests, and includes bug fixes for module invalidation and wdio shadow root handling.
Need More Details?
View the full release notes and all changes for Vitest v4.0.0-beta.5.
View Full Changelog