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

Jest doesn’t support V8 built-in coverage reporting #126

Closed
scythargon opened this issue Jul 3, 2019 · 4 comments
Closed

Jest doesn’t support V8 built-in coverage reporting #126

scythargon opened this issue Jul 3, 2019 · 4 comments

Comments

@scythargon
Copy link

scythargon commented Jul 3, 2019

Hi!
I've found this thread #115 but still haven't figured out the answer.
How to use --include properly?
I want to calculate the coverage for the whole project.
Tried like this for example:
"test": "NODE_ENV=test NODE_V8_COVERAGE=coverage c8 --include [\"**/*.{js,jsx}\"] jest --color --forceExit --detectOpenHandles --maxWorkers=5", but also got only empty report (not empty without --include)
BTW there is no config file currently, right? Only CLI parameters.
(yeah, I know that there is a built in nyc coverage in the jest, but it does not work very stable with styled-jsx package - vercel/styled-jsx#436 that's why I'm looking for an alternative coverage tool)

@shinnn shinnn changed the title How to use --include parameter Jest doesn’t support V8 built-in coverage reporting Jul 4, 2019
@shinnn
Copy link
Contributor

shinnn commented Jul 4, 2019

--include is totally unrelated to this issue. The real problem is that the current version of Jest doesn’t work well with V8 coverage. Wait for jestjs/jest#8596 to be merged and you’ll be able to use jest’s --v8-coverage option instead of c8.

@shinnn shinnn closed this as completed Jul 4, 2019
@shinnn
Copy link
Contributor

shinnn commented Jul 4, 2019

Anyway, fill in the issue template next time.

@bcoe
Copy link
Owner

bcoe commented Jul 8, 2019

@scythargon 👋 I'm sure @SimenB would love additional folks to help out with testing Jest's built in coverage functionality 👍 I recommend joining in on that thread that @shinnn linked to.

I'm not quite sure the specifics of why Jest and c8 would be incompatibile, I would think it would work for the simple case of:

c8 jest foo.js

Where I believe problems might arise would be in source-maps, which I believe is being addressed in the work on #8596.

@bcoe
Copy link
Owner

bcoe commented Jul 8, 2019

to @shinnn's point, it's easier for us to help debug if you can provide a snippet of code or repo that demonstrates the issue you're having ... in your case however, I think you'll find the experimental branch in Jest helps a ton.

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