You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bun test --coverage marks first import line uncovered for class extending factory-call result #29691
DA:1,0 is the bad line-level accounting here: line 1 is just the import, but the module is imported and line 2 is evaluated.
What is the expected behavior?
subject.ts should report 100% line coverage for this repro. The first import line should not be marked uncovered when the module is loaded.
If Bun counts a synthetic constructor/function for class Derived extends Base() {}, I would still expect that synthetic function not to penalize source coverage, since there is no user-authored constructor body to exercise.
What do you see instead?
Bun reports subject.ts at 50.00 line coverage and records the first import line as uncovered in lcov (DA:1,0). It also reports 0.00 function coverage for subject.ts.
Additional information
This looks related to coverage bugs like #7025, but I think this repro is narrower and shows an additional line-coverage problem: the import line itself is recorded as uncovered when the file contains an empty class body extending a factory-call result.
✅ Reproduced — DA:1,0 for the import line comes from JSC filing a synthetic default class constructor range against the user sourceID with offsets that live in a different (synthetic) source. Fix in progress → #29693
Activity
robobun commentedon Apr 24, 2026
✅ Reproduced —
DA:1,0for the import line comes from JSC filing a synthetic default class constructor range against the user sourceID with offsets that live in a different (synthetic) source. Fix in progress → #29693test(coverage): drop synthetic default class constructor ranges
test(coverage): cover classes that do not declare a constructor
Source positions: coverage, stack frames, call sites and source maps …