Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jest coverage report in html missing coverage values

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:

enter image description here

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.

like image 747
Peter Avatar asked Jan 19 '20 06:01

Peter


1 Answers

I had this as well. Updating the package istanbul-reports to the latest version (3.0.0 at the time) fixed the issue.

like image 167
gregtheross Avatar answered Oct 23 '22 06:10

gregtheross