Skip to content

Commit

Permalink
docs: setting for coverage reports directory (#2400)
Browse files Browse the repository at this point in the history
* Document setting the coverage reports directory

This took a lot of trial and error to get to work, so it should be documented to save other people the 2 hours of research it took me to get it working.

* Apply suggestions from code review

* Apply suggestions from code review

* Update docs/guide/coverage.md

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>

* Update docs/guide/coverage.md

Co-authored-by: Anjorin Damilare <damilareanjorin1@gmail.com>
  • Loading branch information
TheJaredWilcurt and dammy001 committed Dec 4, 2022
1 parent e11986d commit 6d75630
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/guide/coverage.md
Expand Up @@ -89,6 +89,22 @@ export default defineConfig({

Please refer to the type definition for more details.

## Changing the default coverage folder location

When running a coverage report, a `coverage` folder is created in the root directory of your project. If you want to move it to a different directory, use the `test.coverage.reportsDirectory` property in the `vite.config.js` file.

```js
import { defineConfig } from 'vite'

export default defineConfig({
test: {
coverage: {
reportsDirectory: './tests/unit/coverage'
}
}
})
```

## Ignoring code

Both coverage providers have their own ways how to ignore code from coverage reports.
Expand Down

0 comments on commit 6d75630

Please sign in to comment.