bug: finally block in async function indicates incorrect missing block coverage
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
## Observed Behavior
The following code:
```js
async function abc() {
try {
return 'abc';
} finally {
console.log('in finally');
} // this is a covered line but uncovered branch
}
abc()
```
Ends up having the following coverage output:
```json
{
"functionName": "abc",
"ranges": [
{
"startOffset": 0,
"endOffset": 146,
"count": 1
},
{
"startOffset": 97,
"endOffset": 145,
"count": 0
}
],
"isBlockCoverage": true
}
}
```
This indicates that the following characters were tracked as an uncovered block:
```
// this is a covered line but uncovered branch\n
```
## Expected behavior
Coverage should be 100% in the above example.
Contributor guide
Assessment
This issue has not been assessed yet.