-
Notifications
You must be signed in to change notification settings - Fork 91
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
Why does --all not observe ignore comments? #318
Comments
Ah! This explains why my ignore statements aren't working. I'm using native Node.js ES Modules in my codebase (so no Babel compilation or anything) and my tests thoroughly tested parts of my code base. In other words, some of my codebase was not imported by the tests and totally uncovered. From Checking for "full" source coverage using
This was exactly my situation. c8 was reporting 100% coverage but really I only had 100% coverage of 40% of my codebase. I used the There's nothing in the docs that suggest a developer would want to turn off the ignore feature so they cannot do this:
I like the Thanks for c8! I'm loving it as a replacement of istanbul/nyc on my ES module codebase. |
Perhaps this is a bug in the v8-to-istanbul dependency? Ignore comments are handled by that dependency. And I think |
+1 for this. I also want to use |
Any update on whether this is being worked on / if there's a fix in sight? Makes using c8 with a test runner (where coverage is only calculated for tested files without using |
This should be fixed in latest Repro where
// index.js
console.log("Hello world"); // temp.js
/* c8 ignore next 3 */
module.exports = function sum(a, b) {
return a + b;
}; {
"name": "c8-repro",
"scripts": {
"c8": "c8"
},
"dependencies": {
"c8": "^8.0.0"
}
}
|
If possible, please provide code that demonstrates the problem, keeping it as
simple and free of external dependencies as you are able.
When using the --all flag for the c8 report command, any c8 ignore statements are ignored and code inside of them is reported on? From the description of the --all command, (here)[https://github.com/bcoe/c8#checking-for-full-source-coverage-using---all], it seems like the intended use case is when the user wants to get an understanding of how much of their codebase is covered. However, certain files, such as index.js files or files containing simple logic are commonly not tested and do not need to have coverage information. Does it then follow that the way that c8 provides to handle these situations, namely /* c8 ignore */, should then exclude them from any form of coverage reporting?
The text was updated successfully, but these errors were encountered: