Skip to content

Upgrading @vitest/coverage-v8 1 to 2

Breaking1.6.1 → 2.1.9Breaking47Security4Deprecated2New90Changed21Fixed287Other1

BreakingUpgrade verdict

40 breaking changes and 4 security fixes.

  • TypeScript users referencing `sequence.concurrent` on `RuntimeConfig` will see a type error.
  • Removes the --segfault-retry flag; the forks pool is now the recommended default.
  • Renames the none provider to preview and makes it the default.
  • Enables coverage.ignoreEmptyLines by default, which may significantly change coverage results versus v1.
Top 5 of 46 that need code or config changes

@vitest/coverage-v8 publishes an official migration guide for version 2. It covers more than the release notes do.

Documentation ↗

Adds tinyrainbow ^1.2.0.

Drops picocolors, strip-literal.

Installs 72 packages in all (was 41).

Breaking40
Removes sequence.concurrent from the RuntimeConfig type.
RuntimeConfigsequence.concurrent
Removes the --segfault-retry flag; the forks pool is now the recommended default.
--segfault-retry
Renames the none provider to preview and makes it the default.
nonepreview
Enables coverage.ignoreEmptyLines by default, which may significantly change coverage results versus v1.
coverage.ignoreEmptyLines
Removes the watchExclude option.
watchExclude
Changes the default pool to 'forks' for compatibility, which may be slightly slower than threads.
pool
Renames indexScripts to orchestratorScripts in the browser config.
indexScriptsorchestratorScripts
Removes the empty suite from the runner.
Removes process.exit when a workspace project fails to be created.
process.exit
Removes deprecated options.
Removes the browser.fileParallelism option.
browser.fileParallelism
Renames indexScripts to orchestratorScripts.
indexScriptsorchestratorScripts
Remove deprecated options.
Changes the default pool option to 'forks'.
pool
Removes the empty suite from the runner.
Removes the --segfault-retry option.
--segfault-retry
Enables coverage.ignoreEmptyLines by default.
coverage.ignoreEmptyLines
Removes the watchExclude option.
watchExclude
Reverts support for Vite 6 because it introduced breaking changes; support will be enabled later.
vitevitestpnpm.overrides
Changes how custom glob patterns in the workspace config are treated: any matching file is a Vitest config, any matching folder is a workspace project.
Treats any file matching the workspace glob as a Vitest config and any matching folder as a workspace project with regular config resolution.
vitest.config.tsvite.config.ts
Explains that projects/* matches files and folders, while projects/**/* now matches every file inside projects, not only folders.
Notes that the workspace glob change does not affect non-glob usage.
Makes spec into a class instead of a tuple in the API.
Adds a meta field to the json output.
meta
Stops exiting the process when config loading fails.
Stops calling process.exit manually in the API.
process.exit
Stops exiting the process when global setup has failed.
Adds correct location and snapshot fields to the json reporter; location now requires includeTaskLocation.
locationincludeTaskLocation
Updates the chai dependency to v5.
chai
Makes --merge-reports support coverage.
--merge-reports
Adds support for concurrent suites.
--merge-reports now supports coverage.
--merge-reports
Runs suite hooks in a stack.
Updates the chai dependency to v5.
chai
Adds a vitest list API to print collected tests without running them, changing the custom pool API.
vitest listcollectTestsrunTests
Simplifies mock function generic types and aligns them with jest.
Adds promise-based return assertions and stops auto-resolving returned promises in spy.mock.returns.
spy.mock.returnsspy.mock.settledResultsexpect().toHaveResolved()
Runs suite hooks in a stack, which may make tests run slightly slower.
onTestFinished
Stops adding test files to exclude patterns when coverage.exclude is overridden.
coverage.excludecoverageConfigDefaults.exclude
Security4
Patches a security issue where Browser mode serves arbitrary files (CVE-2025-24963).
Patches a remote code execution issue when visiting a malicious website while the Vitest API server is listening (CVE-2025-24964).
Updates vulnerable test-exclude dependency to v7.
test-exclude
Updates the vulnerable test-exclude dependency to v7.
test-exclude
Deprecated2
Deprecates UserConfig in favor of ViteUserConfig.
UserConfigViteUserConfig
Deprecates old task types and node-reliant types.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: const default: { startCoverage(): Promise<void>; takeCoverage(): Promise<{ result: any[] }>; stopCoverage(): Promise<void>; getProvider(): Promise<V8CoverageProvider> }
  • changed: const default: { getProvider(): Promise<V8CoverageProvider>; startCoverage(): void; takeCoverage(): Promise<unknown>; stopCoverage(): void } → const default: { startCoverage(): void; takeCoverage(): Promise<{ result: Profiler.ScriptCoverage[] }>; stopCoverage(): void; getProvider(): Promise<V8CoverageProvider> }
  • removed: method V8CoverageProvider.clean(clean?: boolean): Promise<void>
  • removed: method V8CoverageProvider.onAfterSuiteRun({ coverage, transformMode, projectName }: AfterSuiteRunMeta): void
  • removed: method V8CoverageProvider.reportCoverage({ allTestsRun }?: ReportContext): Promise<void>
  • removed: method V8CoverageProvider.resolveOptions(): Options
  • removed: property V8CoverageProvider.coverageFiles: Map<ProjectName, CoverageFilesByTransformMode>
  • removed: property V8CoverageProvider.coverageFilesDirectory: string
  • removed: property V8CoverageProvider.ctx: Vitest
  • removed: property V8CoverageProvider.options: Options
  • removed: property V8CoverageProvider.pendingPromises: Promise<void>[]
  • changed: class V8CoverageProvider extends BaseCoverageProvider implements CoverageProvider → class V8CoverageProvider extends BaseCoverageProvider<ResolvedCoverageOptions<'v8'>> implements CoverageProvider
  • changed: property V8CoverageProvider.name: string → property V8CoverageProvider.name: 'v8'
  • changed: property V8CoverageProvider.testExclude: InstanceType<TestExclude> → property V8CoverageProvider.testExclude: InstanceType<typeof TestExclude>
  • added: method V8CoverageProvider.createCoverageMap(): CoverageMap
  • added: method V8CoverageProvider.generateCoverage({ allTestsRun }: ReportContext): Promise<CoverageMap>
  • added: method V8CoverageProvider.generateReports(coverageMap: CoverageMap, allTestsRun?: boolean): Promise<void>
  • added: method V8CoverageProvider.parseConfigModule(configFilePath: string): Promise<magicast.ProxifiedModule<any>>
  • added: property V8CoverageProvider.version: string