Change8

v5.0.0-beta.2

Breaking Changes
📦 vitestView on GitHub →
7 breaking6 features🐛 9 fixes1 deprecations🔧 17 symbols

Summary

This release introduces significant breaking changes, including updating default attachment directories and replacing the `sequential` option with `concurrent`. New features focus on reporter enhancements and improved coverage tracking.

⚠️ Breaking Changes

  • Default `attachmentsDir` changed from `.vitest-attachements/` to `.vitest/attachments/`. Users should update configuration if they rely on the old path.
  • The `sequential` test/suite option has been removed and replaced by the `concurrent` option. Use `concurrent: false` instead of `sequential: true`.
  • Locator representation has changed from a string to an object. Code relying on locators being strings must be updated.
  • The `expect` package has been inlined into Vitest core.
  • Deprecated entry points have been removed. Check imports and update them if necessary.
  • Automock deserialization in `mocker` now deserializes as automock.
  • The default directory for the `blob` reporter and the `--merge-reports` flag is now `.vitest/blob/` instead of the previous default.

Migration Steps

  1. If you were using `attachmentsDir` pointing to `.vitest-attachements/`, update it to `.vitest/attachments/` or configure it explicitly.
  2. Replace usage of `sequential: true` in test/suite options with `concurrent: false`.
  3. Update any code that relies on locators being represented as strings, as they are now objects.
  4. Remove imports relying on deprecated entry points.
  5. If using the `blob` reporter or `--merge-reports`, note that the default output directory is now `.vitest/blob/`.

✨ New Features

  • Default reporters are now exposed through `configDefaults.reporters`.
  • Support for merging reports for non-sharded multi-environment runs has been improved.
  • Added `logger.formatError` utility.
  • Project reference is now provided in `ToMatchScreenshotResolvePath` in the browser environment.
  • V8 coverage now tracks `node:child_process` and `node:worker_threads` contexts.
  • Added jest-junit-compatible naming options for the `junit-reporter`.

🐛 Bug Fixes

  • Fixed an issue where global `sequence.concurrent: true` conflicted with top-level `test(..., { concurrent: false })`.
  • Test `tags` options now correctly overwrite inherited suite options, and suite options are correctly inherited in the `task` API.
  • Updated optimize deps configuration.
  • Fixed trace highlight of shadow DOM on webdriverio in the browser environment.
  • Updated ivya dependency to fix empty aria tree snapshot issues.
  • Propagated chainable flags in `describe.for`.
  • Concurrency is now limited per task branch in addition to per leaf callbacks.
  • Empty string is now treated as a valid snapshot.
  • Support for private method spy types has been added to `spy`.

Affected Symbols

⚡ Deprecations

  • The `sequential` test/suite option is deprecated in favor of `concurrent`.