@vitest/spy
5.0.5 · 15 Oct 2026MIT202.7M / weekRepositoryHomepagenpmAtom feed
0.34.7 is the newest release of 0.34.x.
In short
7 breaking1 deprecated3 new17 fixed1 changed
- breaking
Transform mode affects only test files, not regular files
- breaking
Custom environment now should be processed before Vitest can consume it. It means that you cannot specify a path to a TS file or use import paths that should be processed by Vite.
- breaking
Disable
coverage.reportOnFailureby default - breaking
Remove
@vitest/coverage-c8package - breaking
Support running tests using VM context
- breaking
vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node
- breaking
Add preact example, remove optimizer experimental status, enable by default
- deprecated
Deprecate deps.registerNodeLoader
Release note
Breaking Changes
- breaking
Transform mode affects only test files, not regular files
transformModeis now moved toserver.transformMode. This option is highly discouraged to use. If you need to change the transform mode, use the new optiontestTransformModeinstead to control the mode based on the running test, not the current file path. By default, tests withjsdomorhappy-domusewebtransform mode, and tests usingnodeoredgeenvironment usessrmode. If you have a custom environment, it should providetransformModeproperty.
- breaking
Custom environment now should be processed before Vitest can consume it. It means that you cannot specify a path to a TS file or use import paths that should be processed by Vite.
- breaking
Disable
coverage.reportOnFailureby default - breaking
Remove
@vitest/coverage-c8package@vitest/coverage-c8is no longer supported. Please, use@vitest/coverage-v8instead.
- breaking
Support running tests using VM context
To address speed issues in some applications, Vitest now provides
experimentalVmThreadspool to run your tests using VM Sandboxes environment. Make sure you understand all pitfalls of this pool before opening an issue.
- breaking
Introduce
serveroptionMost of
deps.options are now moved toserver.depswith a deprecation warning. Please, consider usingdeps.optimizerinstead ofdeps.inline/deps.external. Ideally, we would like to move away from usingserver.deps.inlinealtogether.
- breaking
vite-node: Make CLI arguments parsing behavior consistent with node/tsx/ts-node
You now have to provide CLI arguments before the entry point. For example, instead of
vite-node index.ts --watch, you now have to dovite-node --watch index.ts.
- breaking
Add preact example, remove optimizer experimental status, enable by default
deps.optimizeris now enabled by default. This means that Vitest will bundle specified dependencies before running your tests. This field inherits options fromoptimizeDepsandssr.optimizeDepswhich are populated by other plugins (like, Svelte).
Features
Support
describe.sequentialSupport config junit reporter className with env
Running vitest with
--related --watchreruns non-affected tests if they were changed during a run
Bug Fixes
Isolate workers between envs and workspaces
Modify condition
Module Graph view is blocking the Console view
Port the latest
defineConfigtype from viteDon't overwrite Node.js URL global
ForceRerunTriggers correctly triggers a rerun
browser: Don't inline magic-string and estree-walker
browser: Multi-suite coverage
core: DataView comparison does not work in
toStrictEqualcoverage: V8 provider to pick source maps without url query params
coverage: Update
istanbul-lib-instrumentto v6 to fix vulnerable dependencycoverage: Exclude vite virtual modules by default
node: Guard error info
vite-node: Always treat node_modules as modulesDirectory
vite-node: Normalize drive letter to keep the same reference to a module
vite-node: Correctly resolve hmr filepath
watch: Clear screen on all terminals
Performance
- deprecated
Deprecate deps.registerNodeLoader
This option was introduced to support aliasing inside external packages. Please, use
deps.optimizer.webinstead. If you test Node.js applications, consider adding external packages toserver.deps.inline.