cypress-io / code-coverage

Saves the code coverage collected during Cypress tests
MIT License
433 stars 108 forks source link

The index.html show unknown% and a blank report even after out.json has data. #227

Open maddy619 opened 4 years ago

maddy619 commented 4 years ago

image

Out.json image

Versions

 "@cypress/code-coverage": "3.2.2",
    "cypress": "3.6.1",
    "istanbul-instrumenter-loader": "^3.0.1",
    "ngx-build-plus": "^7.8.3",
    "nyc": 15.0.1 

nyc comes with cypress code-coverage plugin

I am working on angular app, using typescript and ts-loader. I am able to successfully instrument code. The folder structure is something like this. Code folder: Project/projects/feature-x/src/app Cypress folder: Project/projects/feature-cypress/cypress.

Coverage.webpack.js is parallel to cypress folder.

bahmutov commented 4 years ago

Can you include DEBUG logs please https://github.com/cypress-io/code-coverage#debugging or give a link to the repo?

johanbook commented 4 years ago

I'm experiencing a similar problem. The file nyc_output/out.json is populated with data and I use @cypress/instrument-cra which neatly makes __coverage__ available. Reports generated by nyc are empty. However, the report generated by Cypress in coverage/lcov-report/index.html renders as it's supposed to.

ari-luokkala commented 3 years ago

What is the situation with this, I get same behaviour as described above, html report is generated, also nyc out.json, but nyc command line tool bundled within generates always 'Unknown' for code coverage?

Versions: node v12.18.4 +

"@cypress/code-coverage": "3.9.5",
"cypress": "7.3.0",
Isurunc commented 3 months ago

@bahmutov bahmutov what could be the reason for this? Could you provide a solution for this

bahmutov commented 3 months ago

@Isurunc I don't maintain this plugin, I have my own fork here https://github.com/bahmutov/cypress-code-coverage

Isurunc commented 3 months ago

@Isurunc I don't maintain this plugin, I have my own fork here https://github.com/bahmutov/cypress-code-coverage

thanks. will check