c8 reporting 100% coverage on function which throws
- Version: v16.13.2
- Platform: Darwin Aarons-MacBook-Pro.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64 x86_6
I have a project that I am refactoring, and c8 is reporting incorrect coverage for the files.
This is the coverage I have when I am trying to view test coverage:

The test that is being run:

If needed, this is the project: monorepo-coverage
I recommend using environment variables to print the error log, these hints may help you solve the problem:

The command is NODE_DEBUG=c8 yarn test:unit:cover
@bvanjoi unfortunately those do not affect my coverage results, and I would be concerned if they did - what I've done to fix those is just use --exclude dist but no change in coverage
I've "fixed" it by placing the return statement in an else block. I don't think that should be the fix though, I believe that c8/v8 shouldn't report lines after a throw as being covered.
If there is some flag I should enable please let me know - I have tried a few other things already.
This is most likely an underlying issue with v8 vs., c8. Will need to dig into raw output to actually see what's happening.
let me know if there's anything more I can provide