Implicit `else` clause is not considered in coverage.
Open
feature-request
v8
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
Consider the code below.
```js
const x = 'asdf'
const fn = y => {
if (typeof y !== 'object') {
y = 'yup'
}
console.log(y)
}
fn(x)
```
The code branches on the if statement and the behavior changes if it’s false, but there isn’t an explicit `else` clause.
When running `nyc` this correctly says that only 50% of the branch coverage was detected, but in `c8` it reports that 100% of the branch coverage was covered. The output can be found in [this gist](https://gist.github.com/mikeal/60aea513165c35ac438f6a35f0727a75).
Contributor guide
Assessment
This issue has not been assessed yet.