-
Notifications
You must be signed in to change notification settings - Fork 91
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
missing coverage of closing brace in switch/case when const is declared #497
Comments
I have the exact same issue covering this function: https://gitlab.com/eric.morand/twing/-/blob/one-hundred/src/lib/parser.ts?ref_type=heads#L348 |
@tbiesemann , in case you are still struggling with the issue, know that if you actually scope your cases body, the issue disappears: function huhu(someValue) {
switch (someValue) {
case true: {
const result = 42;
return result;
}
default: {
return 43;
}
}
};
huhu(true);
huhu(false); I still don't have an explanation why, but, with your original file, the coverage data emitted by V8 actually include an uncovered range at 144:145 - that is just after the This is probably worth raising an issue at v8 repository. |
@tbiesemann , @bcoe , I opened an issue in node.js issue tracker. This is likely to be a v8 issue but since I'm using node.js to reproduce the issue, I have to start there. |
There's another open c8 issue #229 asking about an uncovered line of a finally block. I am not sure whether these are related to the same underlying v8 issue but perhaps the repro linked in the comment can help with troubleshooting. That other issue's coverage output looks eerily similar: |
Execute with
Reported coverage:
If i omit the const declaration and just return 42; the coverage is 100%.
Expectation is to have 100% coverage for the above snippet.
The text was updated successfully, but these errors were encountered: