-
Notifications
You must be signed in to change notification settings - Fork 90
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
Wrong branches count #541
Comments
6 tasks
Probably consequence of #172 |
Try // example.c8.js
export function comp(a, b) {
if (a > b) return 1;
if (a < b) return -1;
return 0;
}
comp(1, 1)
comp(1, 0) c8 --experimental-monocart node example.c8.js
---------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
---------------|---------|----------|---------|---------|-------------------
All files | 88.88 | 75 | 100 | 100 |
example.c8.js | 88.88 | 75 | 100 | 100 | 4
---------------|---------|----------|---------|---------|------------------- Or try native V8 coverage reports c8 --experimental-monocart --reporter=v8 --reporter=console-details node example.c8.js
┌───────────────┬─────────┬────────────┬──────────┬───────────┬─────────┬─────────────────┐
│ Name │ Bytes │ Statements │ Branches │ Functions │ Lines │ Uncovered Lines │
├───────────────┼─────────┼────────────┼──────────┼───────────┼─────────┼─────────────────┤
│ example.c8.js │ 92.70 % │ 88.89 % │ 75.00 % │ 100.00 % │ 85.71 % │ 4 │
├───────────────┼─────────┼────────────┼──────────┼───────────┼─────────┼─────────────────┤
│ Summary │ 92.70 % │ 88.89 % │ 75.00 % │ 100.00 % │ 85.71 % │ │
└───────────────┴─────────┴────────────┴──────────┴───────────┴─────────┴─────────────────┘
|
Thanks. I wasn't aware of it |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code shows 75% (3/4) branches coverage
This code shows 75% (3/4) branches coverage:
But this code shows 80% (4/5) branches coverage:
Istanbul shows 75% for all examples.
PS maybe you know how branches counted? To me it seems that there are 3 branches
The text was updated successfully, but these errors were encountered: