@vitest/expect
5.0.5 · 15 Oct 2026MIT151.9M / weekRepositoryHomepagenpmAtom feed
3.2.7 is the newest release of 3.x.
In short
1 deprecated19 new28 fixed
- deprecated
Deprecate
workspacein favor ofprojects
Release note
Features
Provide
ctx.signalSupport custom colors for
test.nameAdd
vi.mockObjectto automock any objectIntroduce
watchTriggerPatternsoption- deprecated
Deprecate
workspacein favor ofprojects Explicit Resource Management support in mocked functions
Add
sequence.groupOrderoptionInitial support for Temporal equality
Support Vite 7
Track module execution totalTime and selfTime
Annotation API
browser: Implement
connectoption forplaywrightbrowser providerbrowser: Add
screenshot.saveoptionbrowser: Custom locators API
coverage: V8 experimental AST-aware remapping
reporter: Add
onWritePathoption togithub-actionsvitest: Allow per-file and per-worker fixtures
Bug Fixes
Replace
micromatchwithpicomatchTry to catch unhandled error outside of a test
Generate a separate config for "vitest init browser" instead of a workspace file
Switch ExpectStatic
anytypes toAsymmetricMatcher<unknown>, withDeeplyAllowMatchers<T>Remove unused exports
Throw an error if typechecker failed to spawn
Ignore non-string
stackpropertiesApply browser CLI options only if the project has the browser set in the config already
Ensure errors keep their message and stack after
toJSONserialisationbrowser: Resolve FS commands relative to the project root
browser: Run tests serially if provider doesn't provide a mocker
browser: Resolve
uploadfiles relative to the project rootbrowser: Await mocker invalidation to avoid race condition with "mock wasn't registered"
browser: Share vite cache with the project cache
browser: Add
thistype tolocators.extendcache: Preserve test results from previous runs
cli: Add built-in reporters list to --help output
cli: Parse
--silentvalues properlycoverage: 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/chaiexpect: 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 listcommandtypecheck: Avoid creating a temporary tsconfig file when typechecking
vite-node: Add
__vite_ssr_exportName__vitest: Adjust
getWorkerMemoryLimitpriority for vmForkswdio: Don't scale browser in headless mode