Skip to content

Commit

Permalink
feat(coverage): support /* v8 ignore... ignore hints (vitest-dev#4573)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio authored and LorenzoBloedow committed Dec 19, 2023
1 parent 4584baf commit e09bf62
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/guide/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ Beware that these ignore hints may now be included in final production build as
if (condition) {
```

For `v8` this does not cause any issues. You can use `c8 ignore` comments with Typescript as usual:
For `v8` this does not cause any issues. You can use `v8 ignore` comments with Typescript as usual:

<!-- eslint-skip -->
```ts
/* c8 ignore next 3 */
/* v8 ignore next 3 */
if (condition) {
```
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/coverage-test/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function run() {
divide(1, 1)
}

/* c8 ignore next 4 */
/* v8 ignore next 4 */
/* istanbul ignore next -- @preserve */
export function ignoredFunction() {
throw new Error('Test files should not call this function!')
Expand Down

0 comments on commit e09bf62

Please sign in to comment.