bcoe / c8

output coverage reports using Node.js' built in coverage
ISC License
2k stars 91 forks source link

Ignore statements not working correctly for barrel/index files #359

Open beyerleinf opened 2 years ago

beyerleinf commented 2 years ago

As the title states, I found an issue with ignore statements in barrel/index files that just re-export other modules. Coverage gets reported incorrectly and the ignore comments actually add statements to the file. Also, I think /* c8 ignore file */ would be nice 😊

image

Example repo: beyerleinf/c8-barrel-test - just run npm t and open coverage/index.html.

bcoe commented 2 years ago

I don't believe this behavior was ever implemented in v8-to-istanbul.

beyerleinf commented 2 years ago

In case it matters, I just noticed that this also happens for files that only contain interfaces - which is pretty annoying 😄

maciejregula commented 1 year ago

I have the same issue.

xolott commented 1 year ago

Same here

image
srl295 commented 1 year ago

i have the 'interface-only' issue, any workarounds?