-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"c8 check-coverage --all" do not works like intended #187
Labels
Comments
I think I see the problem. I wrote an integration test to simulate this use case that looks like this: it.only('should allow for --all to be used with the check-coverage command (2 invocations)', () => {
// generate v8 output
let result = spawnSync(nodePath, [
c8Path,
'--temp-directory=tmp/all-check-coverage-as-command',
'--clean=false',
'--check-coverage',
'--lines=90',
'--all=true',
'--include=test/fixtures/all/vanilla/**/*.js',
'--exclude=**/*.ts', // add an exclude to avoid default excludes of test/**
nodePath,
require.resolve('./fixtures/all/vanilla/main')
])
console.log(result.output.toString())
// invoke check-coverage as a command with --all
result = spawnSync(nodePath, [
c8Path,
'check-coverage',
'--lines-100',
'--temp-directory=tmp/all-check-coverage-as-command',
'--clean=false',
'--all=true',
'--include=test/fixtures/all/vanilla/**/*.js',
'--exclude=**/*.ts' // add an exclude to avoid default excludes of test/**
])
console.log(result.output.toString())
}) The resulting output of this looks like:
In the 2nd run it looks like we're not taking into account the unloaded files and getting a coverage for loaded files only. Will fix. |
j03m
added a commit
to j03m/c8
that referenced
this issue
Jan 12, 2020
Fixes: bcoe#187 When implementing all I neglected to supply it when building `Report` in the `check-coverage.js` command. This commit rectifies that and adds two test cases for `check-coverage` as a flag and command used in conjunction with `--all` to prevent regression. **Snapshot updated**
1 task
Yes it works now ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I want to both check a global coverage and a per file coverage so i need to call check-coverage separately.
If i have a file uncovered named foo.js,
calling
c8 --all --include build --check-coverage
works perfectly. It will fail telling me foo.js does not meet threshold.but calling
c8 --all --include build
and later callc8 check-coverage --all --include build
does not works. It doesn't throw an error.The text was updated successfully, but these errors were encountered: