Vitest supports native code coverage via v8 and instrumented coverage via istanbul; both are optional, v8 is the default, and test.coverage.provider selects the tool. The support packages are @vitest/coverage-v8 and @vitest/coverage-istanbul, and Vitest prompts to install the matching one at startup. The v8 provider needs a V8-based runtime such as NodeJS, Deno, or a Chromium browser and collects coverage at runtime through node:inspector or the Chrome DevTools Protocol, so source files run as-is with no pre-instrumentation; since v3.2.0, AST-based remapping makes its reports as accurate as Istanbul's. Its limits: collection cannot be scoped to specific modules, loading many different modules can make it slower than Istanbul, and non-V8 runtimes such as Firefox or Bun are unsupported — even so, the guide marks v8 as the recommended option. Istanbul instruments the source before running, works on any JavaScript runtime, has been battle-tested since 2012, and can limit instrumentation to specific files, which can make it faster than V8 in some cases. Scope: Vitest. Reviewed October 4, 2026.
Code coverage with V8 or Istanbul
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- vitest.dev
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.