-
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
Incorrect coverage reported for ternaries in some situations #61
Comments
Feel free to submit a failing test in a PR :) |
@Trott thanks for filing; @JaKXz for this sort of problem, we'll probably want to look first at the output from V8, and see if the offsets are actually wrong -- if they look right in V8, we know the problem is with our translation to line #s, if they are in fact wrong, we should create an upstream error report in https://bugs.chromium.org. |
did a little bit of testing with Node 13, and a slightly modified sample: 'use strict';
function testIt (a, b) {
const thing = a || b;
console.log(thing);
return a && b;
}
if (testIt(true, true))
console.log('foo'); The coverage seems to work as I'd expect now 👍 |
In file
foo.js
:I run this:
I get this:
I would have expected the coverage for line 4 (the assignment to
thing
) and line 6 (thereturn
statement) to be the same. Instead, it is (correctly) reporting that 6 has some uncovered branches, but is omitting the same thing for line 4.The text was updated successfully, but these errors were encountered: