-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Bug]: Coverage calculation is off when a React.lazy line spans multiple lines #14561
Comments
Does this happen with the latest version of Jest? |
@SimenB I am not able to quickly update my codebase to Jest v29 (since Create-React-App is not longer maintained) My understanding is that coverage information actually come from packages outside of Jest. jest-reporters v29.7 dependencies:
jest-reporters v27.5 has the same dependencies except for |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
1 similar comment
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Version
27.4.3
Steps to reproduce
I have an SPA written in React v17.2.
Formatting of code in this codebase is done by Prettier v3.
Bundling of the app is done by Create-React-App v5
Throughout the app, there are various instances of lazy import:
Most of these lazy importing lines get ignored by Jest in the coverage report.
However, Jest will mark a line as "uncovered" in the Jest coverage report if that line is formatted to be multiple lines by Prettier:
Expected behavior
Multi-line lazy import should be ignored in the same way single-line lazy import is.
Actual behavior
Multi-line lazy import get marked as "uncovered"
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: