Cypress with Istanbul is not generating code coverage reports
Asked Answered
S

1

9

I have VueJS app and Cypress for testing. I need to have code coverage info.

Running tests in Cypress is generating seemingly correct .nyc_output/out.json file with numbers how many times some lines were executed.

How to generate correct report?

Problem is that npx nyc report says that everything is 0% enter image description here

tree .nyc_output/

enter image description here

Sample from the out.json where numbers are different from zero enter image description here

Shend answered 8/8, 2019 at 11:51 Comment(4)
Did you follow the code coverage guide? docs.cypress.io/guides/tooling/code-coverage.htmlFedora
Coverage guide is followed and it all works except the report is not generated.Shend
Any updates? I am facing the same issue. Getting out.json as an empty object.Knute
One guy in our team is able to generate reports on one machine. Did not find any correlation or reason why it does not work otherwise.Shend
R
1

For me, downgrading nyc version solved it

npx [email protected] report
Rrhoea answered 4/2, 2021 at 12:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.