-
Notifications
You must be signed in to change notification settings - Fork 94
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
throw results in an uncovered line #58
Comments
bcoe
changed the title
Line reported as not covered unexpectedly.
throw results in an uncovered line
Jan 22, 2019
Turns out it's not just throw which does this. The following code does the same thing - the function testReturn(doReturn) {
if (doReturn) {
return;
}
}
testReturn(true); |
As far as I investigated, with Node.js v11.13.0, the code on both #58 (comment) and #58 (comment) are regarded as 100%-covered by |
@shinnn confirmed, thanks for pointing this out. |
@coreyfarrell @shinnn awesome \o/ glad to see some of these issues being resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run the above under c8, it reports that line 4 is not covered. Really since line 4 is only a
}
I think it should not even count, having noelse
statement means that line is non-significant. IMO significance of lines comment applies to lines 5 and 6 as well, the}
of a function does not have any actual code. Line 6 is blank so that should not be counted.nyc
basically works the way I expect, though thefunction testThrow(doThrow) {
line isn't part of the total or covered lines. I don't have a strong opinion about counting / not counting the function declaration as a line.The text was updated successfully, but these errors were encountered: