From f9e4ad8310c0ca96e5e1c115ee9fb1d3565c3b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ari=20Perkki=C3=B6?= Date: Thu, 23 Nov 2023 16:29:39 +0200 Subject: [PATCH] feat(coverage): support `/* v8 ignore...` ignore hints (#4573) --- docs/guide/coverage.md | 4 ++-- pnpm-lock.yaml | 10 ++++++++++ test/coverage-test/src/utils.ts | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/guide/coverage.md b/docs/guide/coverage.md index 18beccaaa8c9..91fcbe60be46 100644 --- a/docs/guide/coverage.md +++ b/docs/guide/coverage.md @@ -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: ```ts -/* c8 ignore next 3 */ +/* v8 ignore next 3 */ if (condition) { ``` diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c5d45702abd..295ae2b273b3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25950,6 +25950,16 @@ packages: '@jridgewell/trace-mapping': 0.3.20 '@types/istanbul-lib-coverage': 2.0.6 convert-source-map: 2.0.0 + dev: true + + /v8-to-istanbul@9.2.0: + resolution: {integrity: sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.20 + '@types/istanbul-lib-coverage': 2.0.6 + convert-source-map: 2.0.0 + dev: false /validate-html-nesting@1.2.2: resolution: {integrity: sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==} diff --git a/test/coverage-test/src/utils.ts b/test/coverage-test/src/utils.ts index e7c847325a6b..c0cfad9c9743 100644 --- a/test/coverage-test/src/utils.ts +++ b/test/coverage-test/src/utils.ts @@ -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!')