bcoe / bcoe/c8

missing coverage of closing brace in switch/case when const is declared

Open
#497 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.1k
Forks
99
PR merge metrics
No merged PRs in 30d

Description

* **Node Version**:18.14.0
* **c8 Version**:8.0.1
* **Platform**:Darwin C02C26P7MD6T 23.0.0 Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:42 PDT 2023; root:xnu-10002.1.13~1/RELEASE_X86_64 x86_64

````js
function huhu(someValue) {
switch (someValue) {
case true:
const result = 42;
return result;
default:
return 43;
}
};
huhu(true);
huhu(false);
````

Execute with
````
npx c8 node huhu.js
````

Reported coverage:
image

If i omit the const declaration and just return 42; the coverage is 100%.
Expectation is to have 100% coverage for the above snippet.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.