Change8

v3.1.0

📦 vitestView on GitHub →
13 features🐛 10 fixes🔧 18 symbols

Summary

Vitest 3.1.1 adds numerous new features such as `%$` test titles, diff depth control, configurable plugin hooks, and browser locator enhancements, while fixing flakiness, snapshot handling, and reporter ordering issues.

✨ New Features

  • Introduce `%$` option to add number of the test to its title.
  • Add `diff.maxDepth` option and set non-`Infinity` value as a default to reduce crash.
  • Allow array element for `test.each/for` title formatting.
  • Add `configureVitest` plugin hook.
  • Support `--configLoader` CLI option.
  • Add `vitest-browser-lit` to `vitest init browser` and docs.
  • Use providers request interception for module mocking.
  • Browser: Introduce `and`, `or` and `filter` locators.
  • Reporter: Always render test time.
  • Reporter: `--silent=passed-only` to log failed tasks only.
  • Runner: Add `test.scoped` to override `test.extend` fixtures per-suite.
  • Vitest: Allow conditional `context.skip(boolean)`.
  • Vitest: Support rolldown-vite in `NormalizeUrlPlugin`.

🐛 Bug Fixes

  • Update test stats regularly.
  • Fix vm tests flakiness.
  • Set `diff.expand: false` as default.
  • Browser: Correctly calculate timeout in hooks when actions are performed.
  • Deps: Update all non-major dependencies.
  • Reporter: `--hideSkippedTests` should hide suites too.
  • Reporter: Report tests in correct order.
  • Reporter: Print test only once in the verbose mode.
  • Snapshot: Fix indent normalization.
  • Snapshot: Very old snapshots may be updated, but there is no functional change.

🔧 Affected Symbols

test.eachtest.fordiff.maxDepthdiff.expandconfigureVitestconfigLoadervitest-browser-litproviders request interceptionbrowser.andbrowser.orbrowser.filterreporter.renderTestTimesilent=passed-only flagtest.scopedcontext.skipNormalizeUrlPluginhideSkippedTests flagsnapshot.indentNormalization