Change8

v4.0.14

Breaking Changes
📦 vitestView on GitHub →
1 breaking3 features🐛 9 fixes🔧 16 symbols

Summary

Vitest v4.0.14 introduces experimental browser, runner, and UI features, adds several bug fixes, and renames `collect` to `import` (removing `prepare`), requiring a small migration for affected configurations.

⚠️ Breaking Changes

  • Renamed `collect` to `import` and removed `prepare`. Update any configuration or code that referenced `collect` or `prepare` to use the new `import` option.

Migration Steps

  1. Replace any usage of the old `collect` option with `import`.
  2. Remove references to the now‑removed `prepare` option.
  3. If you relied on the previous `debug` logger, update imports to use the new `obug` logger.

✨ New Features

  • Experimental **browser**: Expose `utils.configurePrettyDOM`.
  • Experimental **runner**: Add full names to tasks.
  • Experimental **ui**: Add tabbed failure view for `toMatchScreenshot` with a comparison slider.

🐛 Bug Fixes

  • Externalize before caching.
  • Collect the duration of external imports.
  • Browser: Unsubscribe `onCancel` on RPC destroy.
  • Browser: Revert the viewport scaling in non‑UI mode.
  • Coverage: Invalidate circular modules correctly on rerun with coverage.
  • Expect: Allow function as standard schema.
  • JSDOM: Reuse abort signals if possible.
  • Pool: Initialise `VITEST_POOL_ID` and `VITEST_WORKER_ID` before environment setup.
  • Web‑worker: `postMessage` now sends ports to workers.

🔧 Affected Symbols

utils.configurePrettyDOMrunner task full namestoMatchScreenshot UI tabbed viewcollectimportprepareVITEST_POOL_IDVITEST_WORKER_IDpostMessage (worker ports)debugobugonCancelviewport scalingcircular modules (coverage)expect schema functionjsdom abort signals