Skip to content

Commit

Permalink
feat(coverage): support /* v8 ignore... ignore hints
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Nov 22, 2023
1 parent 0a14dd8 commit 72405ca
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 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
2 changes: 1 addition & 1 deletion packages/coverage-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"picocolors": "^1.0.0",
"std-env": "^3.4.3",
"test-exclude": "^6.0.0",
"v8-to-istanbul": "^9.1.3"
"v8-to-istanbul": "^9.2.0"
},
"devDependencies": {
"@types/istanbul-lib-coverage": "^2.0.6",
Expand Down
14 changes: 12 additions & 2 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 72405ca

Please sign in to comment.