-
-
Notifications
You must be signed in to change notification settings - Fork 24
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
Investigate --coverage
support
#6
Comments
I would assume coverage doesn't work, but I've been wrong before! 😀 However, adding support for v8 based coverage should be straight forward. E.g. use https://github.com/SimenB/collect-v8-coverage (what Jest uses) and store it as |
Thank you! |
I don't think the coverage works, I added It will be great if we can make it work. |
Yes I assumed |
Yeah, runner needs to hook it up. But should as mentioned be very little code 🤞 |
This CI log maybe useful, I got an error message here Details
|
And the error disappear when add |
EDIT I didn't see you were using c8. |
I wounder why this error been swallowed? #6 (comment) |
See #13, I think that's working 🙂 |
Hi all, this might be obvious for some, but maybe not for others, so I'm leaving it here. The jest-light-runner decreased our running time by almost a 5-fold, which is a tremendous performance increase, thanks! 🎉 We have a big typescript repo that's compiled to js using tsc and we couldn't get the coverage to work trying the proposed on-the-fly babel-register-esm loader option.
We still get no coverage, even though the loader is clearly running: As an alternative, we found we can use the v8 instrumentation and c8 outside of jest as follows:
Our jest config looks something like this (in its essence):
And a .c8rc.json:
Using v8 coverage does come with it's downsides though: jestjs/jest#11188 |
It's possible that this is already working, because Babel uses this runner and collects a coverage when running it's tests: https://github.com/babel/babel/runs/5789483528. If it already works great, I just need to document it.
It's also possible that it's only working partially, or that it's not working at all and that Babel's coverage reporting is based on something else.
(cc @psychobolt - jestjs/jest#9430 (comment))
The text was updated successfully, but these errors were encountered: