I am unit testing my ReactJS app with Jest and have added configuration to get the code coverage. The coverage works well on cli but when I try to export coverage report as html the values corresponding to each file are not shown in the report. Here is my jest.config.json:
{
"roots": [
"test"
],
"collectCoverage": true,
"coverageReporters": ["text","html"],
"coverageDirectory": "<rootDir>/coverage/"
}
And here is my report generated in coverage folder inside index.html file:
As can be seen the numbers are missing. What coud be the reason when the text report has correct values shown as well. It happens only with html report.
I had this as well. Updating the package istanbul-reports
to the latest version (3.0.0 at the time) fixed the issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With