-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
const defaultExclude = require('@istanbuljs/schema/default-exclude') | ||
const defaultExtension = require('@istanbuljs/schema/default-extension') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
make-github-pseudonymous-again
Contributor
|
||
const findUp = require('find-up') | ||
const { readFileSync } = require('fs') | ||
const Yargs = require('yargs/yargs') | ||
|
@@ -58,6 +59,12 @@ function buildYargs (withCommands = false) { | |
group: 'Reporting options', | ||
describe: 'a list of specific files and directories that should be excluded from coverage (glob patterns are supported)' | ||
}) | ||
.option('extension', { | ||
alias: 'e', | ||
default: defaultExtension, | ||
group: 'Reporting options', | ||
describe: 'a list of specific file extensions that should be covered' | ||
}) | ||
.option('exclude-after-remap', { | ||
alias: 'a', | ||
type: 'boolean', | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require('./async') | ||
|
||
console.info('i am a line of code') | ||
|
||
function apple (awesome) { | ||
if (false || true) { | ||
console.info('what') | ||
} | ||
if (true || false) { | ||
console.log('hey') | ||
} | ||
} | ||
|
||
function missed () { | ||
|
||
} | ||
|
||
function missed2 () { | ||
|
||
} | ||
|
||
apple() | ||
apple() | ||
apple() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -125,6 +125,25 @@ All files | 100 | 100 | 100 | 100 | | |
," | ||
`; | ||
|
||
exports[`c8 --extension includes coverage when extensions specified 1`] = ` | ||
",hey | ||
i am a line of code | ||
what | ||
hey | ||
what | ||
hey | ||
what | ||
hey | ||
--------------------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------------|---------|----------|---------|---------|------------------- | ||
All files | 83.33 | 85.71 | 66.66 | 83.33 | | ||
async.js | 100 | 100 | 100 | 100 | | ||
custom-ext.special | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 | ||
--------------------|---------|----------|---------|---------|------------------- | ||
," | ||
`; | ||
|
||
exports[`c8 ESM Modules collects coverage for ESM modules 1`] = ` | ||
",----------|---------|----------|---------|---------|------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
|
@@ -175,44 +194,44 @@ hey | |
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
All files | 73.37 | 59.03 | 62.5 | 73.37 | | ||
All files | 73.6 | 59.03 | 62.5 | 73.6 | | ||
bin | 78.84 | 60 | 66.66 | 78.84 | | ||
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51 | ||
lib | 77.88 | 54.38 | 72 | 77.88 | | ||
lib | 78.19 | 54.38 | 72 | 78.19 | | ||
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9 | ||
parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185 | ||
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311 | ||
parse-args.js | 97.19 | 58.33 | 100 | 97.19 | 155-156,177-178,191-192 | ||
report.js | 75.47 | 58.33 | 78.57 | 75.47 | ...251,278-279,285-287,308-313 | ||
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98 | ||
lib/commands | 41.28 | 66.66 | 16.66 | 41.28 | | ||
check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69 | ||
report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20 | ||
lib/commands | 41.44 | 66.66 | 16.66 | 41.44 | | ||
check-coverage.js | 18.57 | 100 | 0 | 18.57 | 9-11,14-36,39-53,55-70 | ||
report.js | 80.48 | 62.5 | 50 | 80.48 | 9-10,15-20 | ||
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 | | ||
async.js | 100 | 100 | 100 | 100 | | ||
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 | ||
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
,ERROR: Coverage for lines (73.37%) does not meet global threshold (101%) | ||
,ERROR: Coverage for lines (73.6%) does not meet global threshold (101%) | ||
ERROR: Coverage for branches (59.03%) does not meet global threshold (82%) | ||
ERROR: Coverage for statements (73.37%) does not meet global threshold (95%) | ||
ERROR: Coverage for statements (73.6%) does not meet global threshold (95%) | ||
" | ||
`; | ||
|
||
exports[`c8 check-coverage allows threshold to be applied on per-file basis 1`] = ` | ||
",,ERROR: Coverage for lines (78.84%) does not meet threshold (101%) for bin/c8.js | ||
ERROR: Coverage for branches (60%) does not meet threshold (82%) for bin/c8.js | ||
ERROR: Coverage for statements (78.84%) does not meet threshold (95%) for bin/c8.js | ||
ERROR: Coverage for lines (18.84%) does not meet threshold (101%) for lib/commands/check-coverage.js | ||
ERROR: Coverage for statements (18.84%) does not meet threshold (95%) for lib/commands/check-coverage.js | ||
ERROR: Coverage for lines (80%) does not meet threshold (101%) for lib/commands/report.js | ||
ERROR: Coverage for lines (18.57%) does not meet threshold (101%) for lib/commands/check-coverage.js | ||
ERROR: Coverage for statements (18.57%) does not meet threshold (95%) for lib/commands/check-coverage.js | ||
ERROR: Coverage for lines (80.48%) does not meet threshold (101%) for lib/commands/report.js | ||
ERROR: Coverage for branches (62.5%) does not meet threshold (82%) for lib/commands/report.js | ||
ERROR: Coverage for statements (80%) does not meet threshold (95%) for lib/commands/report.js | ||
ERROR: Coverage for statements (80.48%) does not meet threshold (95%) for lib/commands/report.js | ||
ERROR: Coverage for lines (90%) does not meet threshold (101%) for lib/is-cjs-esm-bridge.js | ||
ERROR: Coverage for branches (25%) does not meet threshold (82%) for lib/is-cjs-esm-bridge.js | ||
ERROR: Coverage for statements (90%) does not meet threshold (95%) for lib/is-cjs-esm-bridge.js | ||
ERROR: Coverage for lines (97.1%) does not meet threshold (101%) for lib/parse-args.js | ||
ERROR: Coverage for lines (97.19%) does not meet threshold (101%) for lib/parse-args.js | ||
ERROR: Coverage for branches (58.33%) does not meet threshold (82%) for lib/parse-args.js | ||
ERROR: Coverage for lines (75.31%) does not meet threshold (101%) for lib/report.js | ||
ERROR: Coverage for lines (75.47%) does not meet threshold (101%) for lib/report.js | ||
ERROR: Coverage for branches (58.33%) does not meet threshold (82%) for lib/report.js | ||
ERROR: Coverage for statements (75.31%) does not meet threshold (95%) for lib/report.js | ||
ERROR: Coverage for statements (75.47%) does not meet threshold (95%) for lib/report.js | ||
ERROR: Coverage for lines (45%) does not meet threshold (101%) for lib/source-map-from-file.js | ||
ERROR: Coverage for statements (45%) does not meet threshold (95%) for lib/source-map-from-file.js | ||
ERROR: Coverage for lines (100%) does not meet threshold (101%) for test/fixtures/async.js | ||
|
@@ -223,19 +242,19 @@ ERROR: Coverage for statements (75%) does not meet threshold (95%) for test/fixt | |
`; | ||
|
||
exports[`c8 check-coverage check-coverage command with --100 1`] = ` | ||
",,ERROR: Coverage for lines (77.22%) does not meet global threshold (100%) | ||
",,ERROR: Coverage for lines (77.4%) does not meet global threshold (100%) | ||
ERROR: Coverage for functions (66.66%) does not meet global threshold (100%) | ||
ERROR: Coverage for branches (62.35%) does not meet global threshold (100%) | ||
ERROR: Coverage for statements (77.22%) does not meet global threshold (100%) | ||
ERROR: Coverage for statements (77.4%) does not meet global threshold (100%) | ||
" | ||
`; | ||
|
||
exports[`c8 check-coverage exits with 0 if coverage within threshold 1`] = `",,"`; | ||
|
||
exports[`c8 check-coverage exits with 1 if coverage is below threshold 1`] = ` | ||
",,ERROR: Coverage for lines (73.37%) does not meet global threshold (101%) | ||
",,ERROR: Coverage for lines (73.6%) does not meet global threshold (101%) | ||
ERROR: Coverage for branches (59.03%) does not meet global threshold (82%) | ||
ERROR: Coverage for statements (73.37%) does not meet global threshold (95%) | ||
ERROR: Coverage for statements (73.6%) does not meet global threshold (95%) | ||
" | ||
`; | ||
|
||
|
@@ -318,17 +337,17 @@ exports[`c8 report generates report from existing temporary files 1`] = ` | |
",--------------------------|---------|----------|---------|---------|-------------------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
All files | 73.37 | 59.03 | 62.5 | 73.37 | | ||
All files | 73.6 | 59.03 | 62.5 | 73.6 | | ||
bin | 78.84 | 60 | 66.66 | 78.84 | | ||
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51 | ||
lib | 77.88 | 54.38 | 72 | 77.88 | | ||
lib | 78.19 | 54.38 | 72 | 78.19 | | ||
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9 | ||
parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185 | ||
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311 | ||
parse-args.js | 97.19 | 58.33 | 100 | 97.19 | 155-156,177-178,191-192 | ||
report.js | 75.47 | 58.33 | 78.57 | 75.47 | ...251,278-279,285-287,308-313 | ||
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98 | ||
lib/commands | 41.28 | 66.66 | 16.66 | 41.28 | | ||
check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69 | ||
report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20 | ||
lib/commands | 41.44 | 66.66 | 16.66 | 41.44 | | ||
check-coverage.js | 18.57 | 100 | 0 | 18.57 | 9-11,14-36,39-53,55-70 | ||
report.js | 80.48 | 62.5 | 50 | 80.48 | 9-10,15-20 | ||
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 | | ||
async.js | 100 | 100 | 100 | 100 | | ||
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 | ||
|
@@ -340,24 +359,24 @@ exports[`c8 report supports --check-coverage, when generating reports 1`] = ` | |
",--------------------------|---------|----------|---------|---------|-------------------------------- | ||
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | ||
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
This comment has been minimized.
Sorry, something went wrong.
bcoe
Owner
|
||
All files | 73.37 | 59.03 | 62.5 | 73.37 | | ||
All files | 73.6 | 59.03 | 62.5 | 73.6 | | ||
bin | 78.84 | 60 | 66.66 | 78.84 | | ||
c8.js | 78.84 | 60 | 66.66 | 78.84 | 22,27-29,32-33,41-43,50-51 | ||
lib | 77.88 | 54.38 | 72 | 77.88 | | ||
lib | 78.19 | 54.38 | 72 | 78.19 | | ||
is-cjs-esm-bridge.js | 90 | 25 | 100 | 90 | 9 | ||
parse-args.js | 97.1 | 58.33 | 100 | 97.1 | 148-149,170-171,184-185 | ||
report.js | 75.31 | 58.33 | 78.57 | 75.31 | ...249,276-277,283-285,306-311 | ||
parse-args.js | 97.19 | 58.33 | 100 | 97.19 | 155-156,177-178,191-192 | ||
report.js | 75.47 | 58.33 | 78.57 | 75.47 | ...251,278-279,285-287,308-313 | ||
source-map-from-file.js | 45 | 100 | 0 | 45 | 39-50,52-67,69-77,81-98 | ||
lib/commands | 41.28 | 66.66 | 16.66 | 41.28 | | ||
check-coverage.js | 18.84 | 100 | 0 | 18.84 | 9-11,14-35,38-52,54-69 | ||
report.js | 80 | 62.5 | 50 | 80 | 9-10,15-20 | ||
lib/commands | 41.44 | 66.66 | 16.66 | 41.44 | | ||
check-coverage.js | 18.57 | 100 | 0 | 18.57 | 9-11,14-36,39-53,55-70 | ||
report.js | 80.48 | 62.5 | 50 | 80.48 | 9-10,15-20 | ||
test/fixtures | 83.33 | 85.71 | 66.66 | 83.33 | | ||
async.js | 100 | 100 | 100 | 100 | | ||
normal.js | 75 | 66.66 | 33.33 | 75 | 14-16,18-20 | ||
--------------------------|---------|----------|---------|---------|-------------------------------- | ||
,ERROR: Coverage for lines (73.37%) does not meet global threshold (101%) | ||
,ERROR: Coverage for lines (73.6%) does not meet global threshold (101%) | ||
ERROR: Coverage for branches (59.03%) does not meet global threshold (82%) | ||
ERROR: Coverage for statements (73.37%) does not meet global threshold (95%) | ||
ERROR: Coverage for statements (73.6%) does not meet global threshold (95%) | ||
" | ||
`; | ||
|
I am getting the following error with c8 7.11.0:
Error: Cannot find module '@istanbuljs/schema/default-extension'
This dependency is absent frompackage.json
.