Upgrading @vitest/coverage-v8 0.33 to 0.34
Breaking0.33.0 → 0.34.6Breaking7Security2Deprecated1New12Changed3Fixed71Other3
BreakingUpgrade verdict
7 breaking changes and 2 security fixes.
In plain terms
- Custom test environments can no longer point to TypeScript files or use import paths that Vite would need to process.
- Coverage reports are no longer generated when tests fail unless you turn the option back on.
- The old coverage package for c8 is gone; use the v8 coverage package instead.
- Dependency settings have moved under a new server option, and the old location still works but warns.
Must act Top 5 of 10 that need code or config changes
What you must change
Breaking7
Custom environments must be processed before Vitest consumes them, so TS file paths and Vite-processed import paths no longer work.
Disables coverage.reportOnFailure by default.
coverage.reportOnFailureRemoves the @vitest/coverage-c8 package in favor of @vitest/coverage-v8.
@vitest/coverage-c8@vitest/coverage-v8Introduces the server option and moves most deps options to server.deps with a deprecation warning.
serverserver.depsdeps.optimizerdeps.inlinedeps.externalvite-node CLI arguments must now come before the entry point, matching node/tsx/ts-node.
vite-nodeEnables deps.optimizer by default and removes its experimental status.
deps.optimizeroptimizeDepsssr.optimizeDepsTransform mode now affects only test files, not regular files; transformMode moves to server.transformMode.
transformModeserver.transformModetestTransformModeSecurity2
Restricts access to the file system via the API.
Updates istanbul-lib-instrument to v6 to fix a vulnerable dependency.
istanbul-lib-instrumentDeprecations to plan for
Deprecated1
Deprecates deps.registerNodeLoader in favor of deps.optimizer.web or server.deps.inline.
deps.registerNodeLoaderdeps.optimizer.webserver.deps.inline