Change8

Migrating to Vitest v5.0.0-beta.6

Version v5.0.0-beta.6 introduces 8 breaking changes. This guide details how to update your code.

Released: 7/6/2026

8
Breaking Changes
4
Migration Steps
14
Affected Symbols

⚠️ Check Your Code

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

browser.expect.toMatchScreenshot@sinonjs/fake-timersTemporalwebdriveriovi.whensetImmediatesequence configlocalStoragejson reporterjunit reporterhtml reporterlocator action timeoutcoverage.reportsDirectorydeps optimizer query

Breaking Changes

Issue #1

The `browser.expect.toMatchScreenshot` function now requires a `screenshotDirectory` configuration option.

Issue #2

The underlying `@sinonjs/fake-timers` dependency was updated, adding support for mocking the `Temporal` API.

Issue #3

The `webdriverio` package has been removed.

Issue #4

Mocks are now cleared by default before each test run.

Issue #5

localStorage warnings are suppressed on Node 26, and the system will fail gracefully if a worker fails to start.

Issue #6

Reporter output files (json and junit) now default to writing to the `.vitest` directory.

Issue #7

UI API access has been hardened.

Issue #8

The HTML reporter's default output location has been changed to `.vitest`.

Migration Steps

  1. 1
    If using `browser.expect.toMatchScreenshot`, ensure you configure the new `screenshotDirectory` option.
  2. 2
    Review code that relies on mock state persisting across tests, as mocks are now cleared before each test.
  3. 3
    If you were using the removed `webdriverio` package, you must find an alternative solution or dependency.
  4. 4
    If you rely on reporter output files being in the root directory, update your configuration to point to `.vitest` or specify a different output path.

Release Summary

This release introduces `vi.when()` and updates underlying dependencies like fake-timers, while enforcing stricter defaults for mock clearing and reporter output locations, leading to several breaking changes.

Need More Details?

View the full release notes and all changes for Vitest v5.0.0-beta.6.

View Full Changelog