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
An attempt to fix coverage after updating Jest to 25.2.0 #7896
An attempt to fix coverage after updating Jest to 25.2.0 #7896
Conversation
Hey! This wasn't supposed to change with 25.2. We need Babel (or v8) to instrument code, but that should happen regardless of a transformer being defined or not. It's late here now, but I can investigate tomorrow |
The issue is this line: https://github.com/facebook/jest/blob/2c666c21c6efc1fcadaf820cc9b47bf0ac10505a/packages/jest-transform/src/ScriptTransformer.ts#L230 Removing it, or forcing it to |
@SimenB It was late too, I couldn't make sure it's indeed a bug to report. Would you recommend switching to |
The V8 report is faster, while the Babel one is more accurate. I'd take a look at the html report locally and compare them, and decide based on that 🙂 |
E.g. V8 reports that the line 212 is covered now whereas according to Babel it's not. Whom should I trust? :) |
These pages compare coverage for two given commits. Half-red means the line was not covered in the older commit but is covered now. The older report in both cases is the same and was generated by Babel. |
Aha. Probably wrong then 😀 If you could reduce it down and open up a bug report that'd be awesome. Probably something for |
So, sticking with Babel then.
Added this to my OSS to-do list. BTW, what should actually mean "covered" in this specific case?
|
I think ideally covered should mean "both" - coverage should be able to differentiate between " |
Seems like the coverage wasn't collected because of
transform:{}
injest.config.js
.Any idea why we needed this line there? Apparently, it disables the Babel transform, so we probably should disable it conditionally or use
coverageProvider: "v8"
: #7897closes #7893