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

Incorrect Jest coverage #79

Open
dfantonio opened this issue Sep 15, 2022 · 2 comments
Open

Incorrect Jest coverage #79

dfantonio opened this issue Sep 15, 2022 · 2 comments

Comments

@dfantonio
Copy link

When using esbuild-jest to transpile ts to commonjs and running jest --coverage certain branches are shown as not covered. Using babel to transpile and run the tests shows the correct coverage.

With esbuild-jest:
image

With babel:
image

@wit1312
Copy link

wit1312 commented Oct 7, 2022

@dfantonio adding sourcemap: true to esbuild-jest options fixes coverage for me

opiation added a commit to bonfhir/bonfhir1_archive that referenced this issue Apr 3, 2023
This originally came out of some code formatting causing a decrease in
code coverage. Rather than bypass the nuissance, I decided to find some
lines that were missed and test them. I discovered however that jest's
coverage report (at least for `test-support`) shows the wrong line
numbers. This appears to be an issue with `esbuild-jest`[0] so I suspect
other packages will need their Jest configs updated as well even though
the use case is pretty small.

[0]: aelbore/esbuild-jest#79
@munepom
Copy link

munepom commented Apr 21, 2023

@wit1312 Thanks for the good information! Fixed!

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

3 participants