You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a pre-commit hook and other checks to ensure 100% code coverage, but although the summary reports 100% coverage, when I take a look at the report output, I notice uncovered code.
When I enter the numbers above, I get 100 as output, but this is incorrect. As there is no history for this file, I can't figure out why the tmp var is calculated as such.
Maybe for a quick/workable fix, have a configuration option for nyc to check for the actual numbers being equal instead of relying on the percentage.
The text was updated successfully, but these errors were encountered:
#452 moved the percent function from packages/istanbul-lib-coverage/lib/file.js to a new file but didn't change the code. Maybe the +5 should be removed from tmp = (1000 * 100 * covered) / total + 5? This way it would always round down.
I'm unlikely to have time to work on this for a while. Please modify the percent.js in your local node_modules to see if this resolves your issue (should cause it to calculate 99.99% branches). If so I would welcome a patch for this, please just make sure any testing issues are resolved (this might break some snapshot tests).
I now used the workaround to have nyc check the limits 'per file' instead of the total.
I'll try to look into it and provide a patch if time allows, for now, the 'per file' workaround at least saves my team some frustration (as the files should not become so large, or we would have a completely different problem 😄).
We have a pre-commit hook and other checks to ensure 100% code coverage, but although the summary reports 100% coverage, when I take a look at the report output, I notice uncovered code.
I tracked the issue to the following file:
https://github.com/istanbuljs/istanbuljs/blob/master/packages/istanbul-lib-coverage/lib/percent.js
When I enter the numbers above, I get 100 as output, but this is incorrect. As there is no history for this file, I can't figure out why the
tmp
var is calculated as such.Maybe for a quick/workable fix, have a configuration option for
nyc
to check for the actual numbers being equal instead of relying on the percentage.The text was updated successfully, but these errors were encountered: