-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix issue jest 14766 #235
base: main
Are you sure you want to change the base?
fix issue jest 14766 #235
Conversation
@@ -13,6 +13,8 @@ class CoverageInstrumenter { | |||
async startInstrumenting() { | |||
this.session.connect(); | |||
|
|||
await this.postSession('Debugger.enable'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that should be disabled on exit then I assume?
It seems odd to me we need to enable the debugger, tho. any immediate ideas on why?
@SimenB Thanks for the reminder, it has been updated.
But I don't know why, hope someone can explain. |
I tried to do some research as well as to why this is important. Searching GitHub reveals a whole bunch of places where But to repeat @cenfun's link: https://github.com/puppeteer/puppeteer/blob/88df4075171cdd87ad60241dd77028c96b1a7d9b/packages/puppeteer-core/src/cdp/Coverage.ts#L240-L248 This is code written by the Puppeteer authors themselves (i.e. Google) and the do the same. I also have a repro if you'd like: https://github.com/actions-rs-plus/core. If you clone, npm i etc and then do Apply the patch above in node_modules/collect-v8-coverage and all jumps back to 100%. |
fix: patch collect-v8-coverage until SimenB/collect-v8-coverage#235 is merged in
@SimenB is there anything preventing this from being merged? Can I help in any way to push this forward? |
@HarelM I can't speak for Simen, but in our own internal repositories we tried to implement this patch ourselves, and while it worked and fixed coverage reporting for us, it caused steep performance regressions in Jest. |
What good is performance if the data produced is garbage. I'd rather have my tests run slower and have accurate results than faster tests with coverage that is meaningless. |
@mudcovered sure, but, respectfully, why not expect both? Performance and correctness were once possible. Why not now? Also FWIW, you can take a less impactful hit to performance if you use the Babel coverage provider, which absolutely shouldn't be necessary if you already have transpiled JavaScript. It's completely reasonable to expect better from an industry standard testing framework, especially since Node 18 is currently in maintenance mode and will be out of support come April. |
Hi @SimenB |
fix issue jestjs/jest#14766