-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
After merge, unexpected branch not covered
at trailing char {
#43
Comments
How exactly do i run |
Below script simulate collect coverage from different runtime. https://github.com/loynoir/reproduce-istanbul-lib-coverage-737/blob/main/test.sh And c8 is a wrapper for NODE_V8_COVERAGE=dir |
On node v20.5.0, everything seems to work just fine, including the nyc command. What version of node are you using? |
$ git clean -dfx > /dev/null
$
$ node --version
v20.4.0
$ npm i && bash ./test.sh
added 261 packages, and audited 262 packages in 5s
70 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
+ env RUNTIME=node,browser npm exec -- c8 --report-dir build/expected node ./reproduce.mjs
node
browser
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
reproduce.mjs | 100 | 100 | 100 | 100 |
---------------|---------|----------|---------|---------|-------------------
+ env RUNTIME=node npm exec -- c8 --report-dir build/actual/node node ./reproduce.mjs
node
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 83.33 | 50 | 100 | 83.33 |
reproduce.mjs | 83.33 | 50 | 100 | 83.33 | 9-10
---------------|---------|----------|---------|---------|-------------------
+ env RUNTIME=browser npm exec -- c8 --report-dir build/actual/browser node ./reproduce.mjs
browser
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 83.33 | 50 | 100 | 83.33 |
reproduce.mjs | 83.33 | 50 | 100 | 83.33 | 5-6
---------------|---------|----------|---------|---------|-------------------
+ mkdir -p ./build/actual/temp
+ npm exec -- istanbul-merge --out ./build/actual/temp/coverage.json ./build/actual/node/coverage-final.json ./build/actual/browser/coverage-final.json
+ npm exec -- nyc report -r lcov -r text --temp-directory ./build/actual/temp --report-dir ./build/actual
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 100 | 33.33 | 100 | 100 |
reproduce.mjs | 100 | 33.33 | 100 | 100 | 4-8
---------------|---------|----------|---------|---------|-------------------
$ |
ohhh right sorry, it's not that it errors, it's that there's 4 uncovered lines 👀 |
All this package is doing is wrapping istanbul's |
Description
Run
reproduce.mjs
with envRUNTIME=node
andRUNTIME=browser
.Merge
coverage-final.json
from different runtime.Expect 100% coverage.
Actually,
branch not covered
at trailing char{
Reproduce Repo
https://github.com/loynoir/reproduce-istanbul-lib-coverage-737
Related
istanbuljs/istanbuljs#737
https://playwright.dev/docs/api/class-coverage
The text was updated successfully, but these errors were encountered: