Change8

v5.0.0-beta.5

Breaking Changes
📦 vitestView on GitHub →
6 breaking3 features🐛 10 fixes🔧 5 symbols

Summary

This release introduces several breaking changes, including changes to configuration lookup and diagnostic IDs, alongside new features like the `--repeats` CLI option and UI improvements for browser testing. Numerous bug fixes address issues across browser, coverage, and mocking functionality.

⚠️ Breaking Changes

  • Configuration file lookup no longer searches ancestor directories.
  • The `@vitest/runner` package has been inlined; it will no longer be published separately.
  • It is now allowed to mutate the happy-dom/jsdom window object.
  • The `concurrencyId` and `workerId` exposed on TestModule's diagnostics are now 1-based.
  • Browser mode now requires a `sessionId` for orchestrator HTML requests.
  • The `coverage.thresholds.perFile` configuration now accepts an object (previously it might have been implicitly expecting a different structure).

Migration Steps

  1. If you relied on ancestor directories for configuration lookup, ensure your config file is located in the expected project root.
  2. If you were importing from `@vitest/runner` directly, remove that dependency as it is now inlined.
  3. Review code that mutates the happy-dom/jsdom window object, as this behavior is now explicitly allowed and might require updates if previous behavior was relied upon.
  4. If consuming `TestModule` diagnostics, be aware that `concurrencyId` and `workerId` are now 1-based.
  5. Browser tests requiring orchestrator HTML requests must now supply a `sessionId`.
  6. Review `coverage.thresholds.perFile` configuration if you were using it, as it now accepts an object structure.

✨ New Features

  • Browser mode now displays nested mark trace in the UI.
  • Added `--repeats` CLI option to run tests multiple times.
  • The `coverage.thresholds.autoUpdate` function now receives the previous threshold value as an argument.

🐛 Bug Fixes

  • Fixed mixed stdout/stderr log timestamps when using `onUserConsoleLog`.
  • Fixed `importOriginal` behavior when using optimizer and query import.
  • Corrected transform time calculation in the merged coverage report.
  • Browser mode now waits for orchestrator readiness before resolving browser sessions.
  • Browser mode now waits for iframe tester readiness before preparing.
  • Browser mode now encodes `iframeId` in the tester iframe URL.
  • Coverage now avoids matching sibling project roots.
  • Hoisted `vi.mock()` for `vite-plus/test` imports.
  • Prevented test runs from hanging if a worker crashes.
  • Stripped non-serializable functions from the inline diff configuration.

Affected Symbols