Change8

v5.0.0-beta.4

Breaking Changes
📦 vitestView on GitHub →
4 breaking2 features🐛 10 fixes🔧 10 symbols

Summary

This release introduces new features like trace view steps in the browser and HTML reporter single file output, alongside several breaking changes affecting hoistable methods and assertion strictness. Numerous bug fixes address issues across browser, UI, and mocking functionalities.

⚠️ Breaking Changes

  • Throw an error if hoistable methods are outside the top level scope. Ensure hoistable methods are defined at the top level.
  • `toHaveTextContent` is now strict; use `toMatchTextContent` if you require non-strict matching.
  • The public API for the `benchmark` feature has been rewritten. Review usage of benchmark-related functions.
  • In browser mode, `locators.exact` is now enabled by default. This may change locator behavior if it was previously relying on inexact matching.

Migration Steps

  1. If you relied on `toHaveTextContent` for non-strict matching, replace calls with `toMatchTextContent`.
  2. Review and update any usage of the `benchmark` public API due to its rewrite.

✨ New Features

  • Browser mode now shows trace view steps in the editor panel.
  • HTML reporter supports single file output.

🐛 Bug Fixes

  • Preserved `vi.defineHelper` callsite for async error stacks.
  • Respects `disableConsoleIntercept` setting in browser mode.
  • ForceRerunTriggers now correctly uses directory globs against files.
  • Unified typechecking and AST collection processes.
  • Typecheck warnings are no longer printed more than once.
  • Corrected column number when parsing tests.
  • Browser mode fixes: stale source map on watch mode, escaped inline orchestrator scripts, and disabled client `cdp` API when `allowWrite/allowExec` is false.
  • Mocker fixes: skips hoist transform when no AST mock calls are present.
  • UI fixes: fixed module graph in browser mode with --ui, and rendered ANSI color codes in the editor panel inline error widget.
  • WebdriverIO fix: allows `gpu` in headless chrome.

Affected Symbols