Packages

@vitest/expect

5.0.5 · 15 Oct 2026MIT151.9M / weekRepositoryHomepagenpmAtom feed

Your version

3.2.0

2 Jun 2025Where it was published

3.2.7 is the newest release of 3.x.

In short

1 deprecated19 new28 fixed

  • deprecated

    Deprecate workspace in favor of projects

Release note

Features

  • Provide ctx.signal

  • Support custom colors for test.name

  • Add vi.mockObject to automock any object

  • Introduce watchTriggerPatterns option

  • deprecated

    Deprecate workspace in favor of projects

  • Explicit Resource Management support in mocked functions

  • Add sequence.groupOrder option

  • Initial support for Temporal equality

  • Support Vite 7

  • Track module execution totalTime and selfTime

  • Annotation API

  • browser: Implement connect option for playwright browser provider

  • browser: Add screenshot.save option

  • browser: Custom locators API

  • coverage: V8 experimental AST-aware remapping

  • reporter: Add onWritePath option to github-actions

  • vitest: Allow per-file and per-worker fixtures

Bug Fixes

  • Replace micromatch with picomatch

  • Try to catch unhandled error outside of a test

  • Generate a separate config for "vitest init browser" instead of a workspace file

  • Switch ExpectStatic any types to AsymmetricMatcher<unknown>, with DeeplyAllowMatchers<T>

  • Remove unused exports

  • Throw an error if typechecker failed to spawn

  • Ignore non-string stack properties

  • Apply browser CLI options only if the project has the browser set in the config already

  • Ensure errors keep their message and stack after toJSON serialisation

  • browser: Resolve FS commands relative to the project root

  • browser: Run tests serially if provider doesn't provide a mocker

  • browser: Resolve upload files relative to the project root

  • browser: Await mocker invalidation to avoid race condition with "mock wasn't registered"

  • browser: Share vite cache with the project cache

  • browser: Add this type to locators.extend

  • cache: Preserve test results from previous runs

  • cli: Add built-in reporters list to --help output

  • cli: Parse --silent values properly

  • coverage: Istanbul provider to not use Vite preserved query params

  • coverage: Browser + v8 in source tests missing

  • coverage: In-source test cases excluded

  • dev: Fix relay of custom equality testers

  • expect: Unbundle @types/chai

  • expect: Support type-safe declaration of custom matchers

  • reporters: Check the test result again when tests are rerunning

  • spy: Copy over static properties from the function

  • typecheck: Don't panic during vitest list command

  • typecheck: Avoid creating a temporary tsconfig file when typechecking

  • vite-node: Add __vite_ssr_exportName__

  • vitest: Adjust getWorkerMemoryLimit priority for vmForks

  • wdio: Don't scale browser in headless mode