Change8

Migrating to Vitest v4.0.0-beta.10

Version v4.0.0-beta.10 introduces 1 breaking change. This guide details how to update your code.

Released: 9/1/2025

1
Breaking Changes
5
Migration Steps
10
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

browser.providerFactoryTestModule.relativeModuleIdLocator.lengthtoHaveLengthcoverage.autoUpdateimport.meta.resolveexpect.polluseFakeTimersrunnerspyOn

Breaking Changes

Issue #1

browser: Provider configuration now requires a provider factory function instead of a string. Update your browser config to pass a factory (e.g., `provider: () => new MyProvider()`), or migrate existing string values to the new factory format.

Migration Steps

  1. 1
    Replace any browser provider strings with a provider factory function as required by the new API.
  2. 2
    If you used `toHaveLength` with a plain number, you can now pass a locator directly; no code change is required unless you relied on the previous type signature.
  3. 3
    Update any code that constructs `TestModule` objects to use the new `relativeModuleId` field where needed.
  4. 4
    Ensure your project uses tinypool version 2.0.0 or later (the release updates the internal dependency).
  5. 5
    Review your dependency lockfile for the updated non‑major packages and run a fresh install.

Release Summary

Vitest v4.0.0-beta.10 adds a new provider‑factory requirement for browsers, introduces several new API features like `relativeModuleId` and locator length support, and includes multiple bug fixes and performance improvements.

Need More Details?

View the full release notes and all changes for Vitest v4.0.0-beta.10.

View Full Changelog