-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Code Coverage report stating last closing brace as uncovered #10740
Comments
This is an issue either with the transformer not providing correct source maps or with istanbul. At the very least we'll need a full minimal reproduction we can pull down to run and test. Regardless I highly doubt it's a bug in Jest itself, but I've been surprised before 🙂 |
@SimenB okay! I'll work on the reproduction and get back to you soon. Made some tests here and looks like the problem is when two closing braces are after each other, whithout any characters between them (except for \n), like: 01: class A {
02: method(){
03: return;
04: }
05: } Line 4 will be marked as uncovered every single time. |
@SimenB I've managed to reproduce the bug in: https://github.com/VIMGAS/jest-coverage-bug-reproduction The README.md file states how to make it happen. |
Ah no wait! It works on Node 14 correctly, but with node 12 I get the same result as you do. Probably something to do with babel's transform then. I don't think it's an issue with Jest, tho? Closing, but if you still think it's a bug in Jest we can reopen |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
To Reproduce
Steps to reproduce the behavior:
Here is my class:
Here is the lcov output alongside jest
This happens to every single class of mine. As you can see, it is the only factor that makes this particular class not 100% on coverage of statements and lines. Also not sure why branches is not 100% covered here.
Expected behavior
I expected to a closing brace be a covered line of code.
envinfo
The text was updated successfully, but these errors were encountered: