-
Notifications
You must be signed in to change notification settings - Fork 451
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
Coverage map doesn't line up #230
Comments
What happens if you simply run it through tsc and pass it through babel? If this bug also happens with tsc, I feel like we need to raise this issue in another repro. |
@lukescott can you create a minimal repo that reproduces this issue? |
I think it is an issue with babel-plugin-istanbul. I opened an issue here istanbuljs/babel-plugin-istanbul#108. I posted a reproducible repo there. This issue may be relevant to you as ts-jest may suffer from the same problem. |
Excellent, I'm hoping they will fix it and it's not an issue on our end. |
Ok, so I was able to figure it out. Not sure if this is the final solution, but you need to: 1 - Pass I have no idea why this even an option in Jest. If you're doing a coverage report I would assume this should always be called. Interestingly enough you have to return |
Huh, that's really strange. Do you know where the switch is inside jest that makes it ignore the inputsourcemap? |
It's my understanding that inline sourcemaps work as well |
I think this may be related to #211 in some way. I put together a transformer (separate from ts-jest) that "works", but the coverage information doesn't line up with the code.
Here is the transformer:
I've tried:
Every combination I can think of w/ TypeScript + Babel. Fails to line up properly. I am passing the source map from TypeScript into Babel.
Babel by itself. It lines up correctly.
TypeScript by itself. It doesn't line up, but also doesn't show highlights.
I'm at a loss at this point. As far as I can tell Babel/Istanbul does not like TypeScript's source maps.
The text was updated successfully, but these errors were encountered: