Skip to content
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 #751

Open
chulinguy opened this issue Nov 3, 2023 · 1 comment

Comments

@chulinguy
Copy link

chulinguy commented Nov 3, 2023

I initially filed this bug on jest but I think the calculation error is coming from istanbuljs. jestjs/jest#14561

Basically, the coverage calculation seems to have issues with a multi-line React.lazy call

// GOOD
const PageA = React.lazy(() => import('./PATH_TO_FOLDER/PageA'))
const ComponentB = React.lazy(() => import('./PATH_TO_FOLDER/ComponentB'))

// INCORRECTLY SHOWN AS UNCOVERED LINE
const ComponentWithLongNameOrPath = React.lazy(() =>
  import('./PATH_TO_FOLDER/ComponentWithLongNameOrPath')
) 
@chulinguy
Copy link
Author

This bug is also present in jest. Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant