cypress-io / code-coverage

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

cobertura-coverage.xml and lcov.info file empty despite out.json has been created #73

Closed fasatrix closed 5 years ago

fasatrix commented 5 years ago

Current behavior:

The cobertura-coverage.xml and lcov.info files are empty despite out.json has been filled correctly

image

image

image

More info Project Structure image

I have this nyc conf in my package.json image

Using Crypress runner, it looks like the following command failed but have no control on it(see screenshot below):

nyc report --report-dir ./coverage --reporter=lcov --reporter=cobertura --reporter=text-summary --reporter=html

image

but running the command via cli the reporter files (cobertura-coverage.xml, lcov, HTML etc) are still empty. The full command run is:

node_modules/nyc/bin/nyc.js report --report-dir ./coverage --temp-dir ./.nyc_output/ --reporter=lcov --reporter=cobertura --reporter=text-summary --reporter=html
**Screen Coverage summary** 
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )

But you can see the code instrumentation was successful image

Desired behavior:

I'd like the cobertura file to be populated so that I will be able to upload the coverage to a third party service such as Codacy

I'd like the cobertura-coverage.xml and lcov.info file to be populated

Steps to reproduce: (app code and test code)

Instrument the code:

npx nyc instrument src instrumented --extension .tsx **--compact=false**

Change Cypress configuration as per documentation (plugin and support file ) Run the tests ---> .nycoutput and coverage folder created and filled with relevant files

Versions

"cypress": "^3.4.1",, windows 10, Chromium

fasatrix commented 5 years ago

@bahmutov yup I figured that out myself but it's good you added a note in the documentation. Thanks alot

bahmutov commented 4 years ago

:tada: This issue has been resolved in version 1.10.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: