Skip to content
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

if, while, etc. body without braces not always reported in % Stmts, % Lines, or Uncovered Line #s #473

Open
MaxNanasy opened this issue May 23, 2023 · 0 comments

Comments

@MaxNanasy
Copy link

MaxNanasy commented May 23, 2023

Example:

test.js:

import './main.js';

main.js:

if (false)
  void 0;

if (false) {
  void 0;
}

while (false)
  void 0;

while (false) {
  void 0;
}
npx c8 node test.js
----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |   69.23 |       20 |     100 |   69.23 |                   
 main.js  |   69.23 |       20 |     100 |   69.23 | 5-6,12-13         
----------|---------|----------|---------|---------|-------------------

Note how in this case, the if and while bodies with braces are reported under Uncovered Line #s, and factor in to % Stmts and % Lines, while the if and while bodies without braces aren't (although they all seem to factor in to % Branch)

@MaxNanasy MaxNanasy changed the title if, while, etc. body without braces can be inaccurately not reported as uncovered if, while, etc. body without braces not reported in uncovered lines May 23, 2023
@MaxNanasy MaxNanasy changed the title if, while, etc. body without braces not reported in uncovered lines if, while, etc. body without braces not always reported in Uncovered Line #s May 23, 2023
@MaxNanasy MaxNanasy changed the title if, while, etc. body without braces not always reported in Uncovered Line #s if, while, etc. body without braces not always reported in % Stmts, % Lines, or Uncovered Line #s May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant