Coverage in HTML view is broken
See original GitHub issue🐛 Bug Report
To Reproduce
Steps to reproduce the behavior: (same as: https://jestjs.io/docs/en/getting-started)
- Create a new folder
- Init a new npm project with
npm init
- Add Jest as a dependency
npm install --save-dev jest
- Created a
src
folder with amain.js
file and amain.spec.js
test file (one containing sum function and the other the tests as in the Jest docs) - Added a test script in
package.json
. - Run the script with
npm test -- --coverage
- When opening the
coverage/lcov-report/index.html
the HTML does not show the coverage report numbers.
GIT repo here: https://github.com/adyz/jest-coverage-bug-no-ts
Expected behavior
The coverage/lcov-report/index.html
should show the actual report numbers
Link to repl or repo (highly encouraged)
https://github.com/adyz/jest-coverage-bug-no-ts
envinfo
npx: installed 1 in 1.36s
System:
OS: macOS 10.15.2
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries:
Node: 13.6.0 - /usr/local/bin/node
Yarn: 1.12.3 - ~/.yarn/bin/yarn
npm: 6.13.4 - /usr/local/bin/npm
npmPackages:
jest: ^24.9.0 => 24.9.0
Let me know if I should send this to the istanbul.js as well or just there. Not sure where to go from here. I’ve also noticed that on old projects the report is fine until I remove the node_modules and reinstall.
Thanks a ton!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:24 (8 by maintainers)
Top Results From Across the Web
Code coverage HTML rendering is broken
Code coverage preview doesn't work in browser. All icons, tables are broken. https://msrasrg.visualstudio.com/NNIOpenSource/_build/results?
Read more >Jest coverage report in html missing coverage values
As can be seen the numbers are missing. What coud be the reason when the text report has correct values shown as well....
Read more >Code Coverage - Test Runner - Modern Web
In order to see what is missing we can look at the Coverage Report by Command + Click -ing on the link (coverage/lcov-report/index.html)...
Read more >Publish code coverage results v1 task - Microsoft Learn
html file. If the code coverage tab fails to show the code coverage report, check whether the size of the index.html file is...
Read more >How to Generate a Code Coverage Report with CodeCov and ...
Testing prevents you from introducing breaking changes to your codebase ... You can also display a badge showing the coverage report on your ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Deleting the existing
istanbul-reports
from your lockfile and re-runningnpm
oryarn
should fix the issue. It works in the project I tested, so I think we’re good to go 👍Jest upgraded to istanbul v2 as part of the Jest v24 release (in #7016, to be exact), so upgrading to v24 should fix your issue (as it’ll pull in the fixed version of istanbul-reports@2)