How can I use __coverage__ global object generated by istanbul to get code coverage report?

217 Views Asked by At

I'm using istanbul to know what lines of code were executed when I perform an operation on my web app. In order to do this I first instrumented the code using: npx nyc instrument

Then I deployed this code and did my testing. This generated a __coverage__ global object that I have copied into ./.nyc_output/coverage.json

To get the code coverage report, I tried npx nyc report --reporter=html --report-dir=./coverage

However on opening the resultant html file, I see it's empty: index.html

What can I do to fix this?

0

There are 0 best solutions below