@vitest/mocker
5.1.0 · 2 Nov 2026MIT190.8M / weekRepositoryHomepagenpmAtom feed
3.2.7 is the newest release of 3.x.
In short
1 deprecated10 new9 fixed
- Deprecated
Deprecate
workspacein favor ofprojects
Security
2 advisories affect 3.2.0; 4.1.12 fixes them
- ModerateVitest: Code injection via unauthenticated manual mock registrationGHSA-qxg6-89mg-rqv8 · 21 Oct 2026Fixed in 4.1.12
- ModerateVitest: Path Traversal / Arbitrary File Read via @vitest/mocker Redirect MockGHSA-82fw-gwwq-j7x9 · 8 Sep 2026Fixed in 4.1.11
Release note
The section about @vitest/mocker of a note shared by several packages.
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
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
toJSONserialisation
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.