Not getting coverage overlay to work
Environment
-
node -v: 12.16.0 -
npm -v: 6.14.9 -
npm ls jestornpm ls react-scripts(if you haven’t ejected): 26.6.3 -
your vscode-jest settings if customized:
- jest.pathToJest? [fill]
- jest.pathToConfig? [fill]
- anything else that you think might be relevant? - using defaultFormatter (gutter formatter doesn't change results)
-
Operating system: MacOS
Prerequisite
- are you able to run jest test from command line? yes
- how do you run your tests from command line? (for example:
npm run testornode_modules/.bin/jest) run test
Steps to Reproduce
Toggle overlay (icon in status bar shows it is on). I can see coverage stats at top of file
Relevant Debug Info
Expected Behavior
highlight test with code that is covered and code that is not
Actual Behavior
None.
The fastest (and the most fun) way to resolve the issue is to submit a pull-request yourself. If you are interested, feel free to check out the contribution guide, we look forward to seeing your PR...
if you are using the default coverage fomatter, the covered lines will not be marked, only the uncovered lines will be highlighted. What do the stats on top of the file show?
yea, I even introduced some new lines that weren't being covered because I knew that's how it worked. The status on the top was saying there were uncovered lines, just no highlighting.
After restarting the environment and Jest a couple of times it seems like it eventually worked, but I'm not clear what made it do so. Is coverage determined from a run outside of the extension then just shown?
Is coverage determined from a run outside of the extension then just shown
the extension spawns a jest process with coverage then parses the result and displays. If the stats above showed uncovered stats then it probably generated/parsed the coverage report all right but just not showing it correctly. Can you try v4.0.0-alpha.5, the latest release candidate, as we fixed a few bugs related to formatters, it might have already been fixed.