mirror of
https://github.com/zoorpha/rustshare-obsidian-plugin.git
synced 2026-07-22 07:48:14 +00:00
30 lines
814 B
Markdown
30 lines
814 B
Markdown
# @vitest/coverage-v8
|
|
|
|
[](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)
|