Comparing version 7.9.0 to 7.10.0
@@ -5,2 +5,9 @@ # Changelog | ||
## [7.10.0](https://www.github.com/bcoe/c8/compare/v7.9.0...v7.10.0) (2021-10-06) | ||
### Features | ||
* `--100` ([#332](https://www.github.com/bcoe/c8/issues/332)) ([4205f2f](https://www.github.com/bcoe/c8/commit/4205f2f33585693d82c2500d0d6850571965bb8b)) | ||
## [7.9.0](https://www.github.com/bcoe/c8/compare/v7.8.0...v7.9.0) (2021-09-10) | ||
@@ -7,0 +14,0 @@ |
@@ -14,2 +14,10 @@ const { relative } = require('path') | ||
exports.handler = function (argv) { | ||
// TODO: this is a workaround until yargs gets upgraded to v17, see https://github.com/bcoe/c8/pull/332#discussion_r721636191 | ||
if (argv['100']) { | ||
argv.lines = 100 | ||
argv.functions = 100 | ||
argv.branches = 100 | ||
argv.statements = 100 | ||
} | ||
const report = Report({ | ||
@@ -16,0 +24,0 @@ include: argv.include, |
@@ -13,2 +13,10 @@ const { checkCoverages } = require('./check-coverage') | ||
exports.outputReport = async function (argv) { | ||
// TODO: this is a workaround until yargs gets upgraded to v17, see https://github.com/bcoe/c8/pull/332#discussion_r721636191 | ||
if (argv['100']) { | ||
argv.checkCoverage = 100 | ||
argv.lines = 100 | ||
argv.functions = 100 | ||
argv.branches = 100 | ||
argv.statements = 100 | ||
} | ||
const report = Report({ | ||
@@ -15,0 +23,0 @@ include: argv.include, |
@@ -110,2 +110,8 @@ const defaultExclude = require('@istanbuljs/schema/default-exclude') | ||
}) | ||
.option('100', { | ||
default: false, | ||
group: 'Coverage thresholds', | ||
description: 'shortcut for --check-coverage --lines 100 --functions 100 --branches 100 --statements 100', | ||
type: 'boolean' | ||
}) | ||
.option('temp-directory', { | ||
@@ -149,2 +155,15 @@ describe: 'directory V8 coverage data is written to and read from', | ||
// TODO: enable once yargs upgraded to v17: https://github.com/bcoe/c8/pull/332#discussion_r721636191 | ||
// yargs.middleware((argv) => { | ||
// if (!argv['100']) return argv | ||
// return { | ||
// ...argv, | ||
// branches: 100, | ||
// functions: 100, | ||
// lines: 100, | ||
// statements: 100, | ||
// } | ||
// }) | ||
const checkCoverage = require('./commands/check-coverage') | ||
@@ -151,0 +170,0 @@ const report = require('./commands/report') |
{ | ||
"name": "c8", | ||
"version": "7.9.0", | ||
"version": "7.10.0", | ||
"description": "output coverage reports using Node.js' built in coverage", | ||
@@ -40,3 +40,3 @@ "main": "./index.js", | ||
"foreground-child": "^2.0.0", | ||
"istanbul-lib-coverage": "^3.0.0", | ||
"istanbul-lib-coverage": "^3.0.1", | ||
"istanbul-lib-report": "^3.0.0", | ||
@@ -43,0 +43,0 @@ "istanbul-reports": "^3.0.2", |
@@ -38,3 +38,3 @@ # c8 - native V8 code-coverage | ||
| `-n`, `--include` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | `[]` (include all files) | | ||
| `-x`, `--exclude` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | [list](https://github.com/istanbuljs/schema/blob/master/default-exclude.js) | | ||
| `-x`, `--exclude` | see [section below](#checking-for-full-source-coverage-using---all) for more info | `Array<string>` | [list](https://github.com/istanbuljs/schema/blob/main/default-exclude.js) | | ||
| `--skip-full` | do not show files with 100% statement, branch, and function coverage | `boolean` | `false` | | ||
@@ -84,2 +84,20 @@ | `--check-coverage` | check whether coverage is within thresholds provided | `boolean` | `false` | | ||
If you want to check for 100% coverage across all dimensions, use `--100`: | ||
```shell | ||
c8 --100 npm test | ||
``` | ||
Is equivalent to | ||
```shell | ||
c8 --check-coverage --lines 100 --functions 100 --branches 100 --statements 100 npm test | ||
``` | ||
The `--100` flag can be set for the `check-coverage` as well: | ||
```shell | ||
c8 check-coverage --100 | ||
``` | ||
## Ignoring Uncovered Lines, Functions, and Blocks | ||
@@ -86,0 +104,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53156
766
155
Updatedistanbul-lib-coverage@^3.0.1