`c8 ignore next` comment does not quite appropriately compensate for branches
See original GitHub issue- Version: v14.12.0
- Platform: macOS Darwin Kernel Version 19.6.0
Given this code in index.js
:
function fn() {
return true;
/* c8 ignore next */
console.log('never runs');
}
fn();
Running with ci node index.js
, I get this output:
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 100 | 66.67 | 100 | 100 |
index.js | 100 | 66.67 | 100 | 100 | 2
----------|---------|----------|---------|---------|-------------------
I would expect the branches to all be considered covered since the entire uncovered branch is excluded by the c8 ignore
comment.
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
index.js | 100 | 100 | 100 | 100 | 2
----------|---------|----------|---------|---------|-------------------
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Title 26: LABOR AND INDUSTRY - Maine Legislature
The employee representative shall not lose any privilege or compensation during or because of his attendance in any such inspection. [PL 1975, c....
Read more >Skilled Nursing Facilities Patient-Driven Payment Model ...
This report introduces a comprehensive alternative to the current resident classification model (case-mix adjustment) within the skilled nursing facility ...
Read more >Common Data Set 2020-2021 - Fairfield University
In the ratio calculations, exclude both faculty and students in stand-alone graduate or professional programs such as medicine, law, veterinary, dentistry, ...
Read more >Proposed Rule: S7-13-00 - SEC.gov
If investors do not believe that the auditor is truly independent from ... auditor can ignore completely what the firm stands to lose...
Read more >Ibrahim Mahazu, Appellant, vs. Becklund Home Health Care ...
Respondent. Filed July 30, 2002. Affirmed in part, reversed in part, and remanded. Anderson, Judge. Hennepin County District Court. File No.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Trott wow, it too me this long to get to this message in my inbox 😆
I have a cunning plan, I was thinking we could perhaps check if the covered range is only 1 character, at which point I think it’s a good indicator I’ve detected a
\n
character.I’ll play with this soon.
this should be fixed in
c8@7.3.2
.