`if`, `while`, etc. body without braces not always reported in `% Stmts`, `% Lines`, or `Uncovered Line #s`
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Example:
test.js:
```js
import './main.js';
```
main.js:
```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`)
Contributor guide
Assessment
This issue has not been assessed yet.