Files
SnowLuma/.pnpm-store/v11/files/63/40d8bfce63a283b00eb4d519fd91fee1acafb39e62d3197abb6343711aec85968fbb30dcf0b987e3527896e9306c913c2134efb8cac98c704ce07cc2749e02
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

31 lines
814 B
Plaintext

# @vitest/coverage-v8
[![NPM version](https://img.shields.io/npm/v/@vitest/coverage-v8?color=a1b858&label=)](https://npmx.dev/package/@vitest/coverage-v8)
Vitest coverage provider that supports native code coverage via [v8](https://v8.dev/blog/javascript-code-coverage).
## Installation
After installing the package, specify `v8` in the `coverage.provider` field of your Vitest configuration (or leave it empty as it is the default provider):
```ts
// vitest.config.ts
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
coverage: {
provider: 'v8',
},
},
})
```
Then run Vitest with coverage:
```sh
npx vitest --coverage
```
[GitHub](https://github.com/vitest-dev/vitest/tree/main/packages/coverage-v8) | [Documentation](https://vitest.dev/guide/coverage)