jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.84k stars 293 forks source link

Code Coverage Reporting #79

Open benkraus opened 7 years ago

benkraus commented 7 years ago

So, one thing our company likes to see is code coverage numbers. I'd love to see this plugin enable support for this.

Mainly, I'd like to see two things:

Thoughts on the matter?

I'd also love to help build this, though I'm a noob at VS Code extensions.

orta commented 7 years ago

To do useful code coverage, we would need to run the full test suite - feasible, but usually a non-trivial amount of time. That's what makes this hard to do inside this extensions.

I thought about this a bit before - I think this is generally covered by other extensions, notably this one

Ideally vscode-jest wouldn't provide code coverage stats, because it's nearly always running the watcher for just one file. That said, you can test it out by changing the jest.pathToJest to include the CLI params for outputting code coverage files to be picked up by other extensions. Could work well with something to show coverage, in which case we should consider an option to toggle it.

canda commented 7 years ago

And is it possible to integrate nojvek/vscode-coverage as part of vscode-jest ? So out of the box you got a better experience. Perhaps with a feature flag to be able to turn it off?

bookman25 commented 7 years ago

Partial support with #137 It shows uncovered lines in a file and at the top of a file it will show file level coverage.