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 inaccurately reporting less than 100% coverage #9008
Apologies, but I couldn't find a more minimal reproduction of the issue outside of my current side project. However, it should be pretty fast to clone it and run the tests.
The tests do not pass with 100% code coverage. Bun does not report any lines missed.
Through selectively commenting out code, I've narrowed down the issue to line 106 of parse-fen.ts. Commenting out this line and its surrounding if statement fixed the code coverage report, but makes a couple of my tests fail.
I can add a console.log statement before line 106 and see that it runs when running bun test --coverage.
Additional information
Have a nice day!
Reacted by Martin Larsson, Daniel Torscho, Nripendra Nath Newa, Anderson Arboleya, Valentin Kaczmarek, Diego Sogari, Chris and Filip Seman
@Jarred-Sumner Are there any news regarding this? I am in version 1.2.2 and bun still seems to "wrongly" report the coverage.
To my knowledge I tested all methods and also every branch and bun reports no missing lines, but the function coverage is still underwhelming. Would be nice to have a correct coverage report to work with.
Activity
small-angel commentedon Feb 21, 2024
my guess is likely an issue with sourcemap generation
LandonSchropp commentedon Apr 7, 2024
@Paperdave FYI, I tried this with Bun 1.1 and I'm still seeing this issue.
Valle12 commentedon Feb 18, 2025
@Jarred-Sumner Are there any news regarding this? I am in version 1.2.2 and bun still seems to "wrongly" report the coverage.
To my knowledge I tested all methods and also every branch and bun reports no missing lines, but the function coverage is still underwhelming. Would be nice to have a correct coverage report to work with.
dsogari commentedon Mar 3, 2025
In my project, it reports uncovered lines for class getters/setters and properties with initializers.
NullDev commentedon May 24, 2025
+1 from me. It did initially report lines that weren't covered. So I fixed all of them.
Now no lines are reported anymore, but I'm still not at 100%