-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
bun:testSomething related to the `bun test` runnerSomething related to the `bun test` runnerenhancementNew feature or requestNew feature or request
Description
What is the problem this feature would solve?
bun test --coverage reports coverage percentages for functions and lines like Jest/Vitest/etc, but those also report coverage for statements and branches.
More granular reporting like this is especially helpful to ensure full coverage on terse code like chained ternaries, for example.
const chainedTernary =
condition === 1
? result1
: condition === 2
? result2
: result3;I realize this type of code isn't everyone's cup of tea, but it would be really nice to get the statement and branch coverage numbers from Bun.
What is the feature you are proposing to solve the problem?
Include statement and branch coverage percentages in bun test --coverage reports. Something like this in the CLI:
---------------|---------|---------|---------|---------|-------------------
File | % Funcs | % Lines | % Stmts | % Brnch | Uncovered Line #s
---------------|---------|---------|---------|---------|-------------------
All files | 100.00 | 100.00 | 90.00 | 80.00 |
src/index.ts | 100.00 | 100.00 | 90.00 | 80.00 | 25,50
---------------|---------|---------|---------|---------|-------------------
^^^^^^^^^^^^^^^^^^^^
I assume this would affect the lcov output as well (see #4015).
What alternatives have you considered?
Sticking with Jest for now.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bun:testSomething related to the `bun test` runnerSomething related to the `bun test` runnerenhancementNew feature or requestNew feature or request