Open rk011219 opened 2 years ago
I'm seeing this as well with combined reports from Jest and Cypress
When running only Cypress the coverage i.e. in statements is 86.29% but after merging coverage from Cypress & Jest it drops to 80.17%. Does anyone here know how to fix this?
The issue is summarized with:
The proper fix for this issue is for the e2e tests code-coverage plugin to report all lines the same way jest does
When I inspected the source instrumented code I found e2e test ignoring some lines from instrumenting causing the problem we are facing
The issue is summarized with:
- Unit tests (Jest) explicitly report uncovered lines.
- E2E tests (Cypress) only report covered lines, omitting uncovered ones.
- When merging coverage reports, this leads to underreporting of overall coverage coming from unit tests
The proper fix for this issue is for the e2e tests code-coverage plugin to report all lines the same way jest does
When I inspected the source instrumented code I found e2e test ignoring some lines from instrumenting causing the problem we are facing
Hi @MKhasib ,
Thanks for sharing the idea for this, could you help sharing what documents you have been modified for this issue?
Thanks
Logs and screenshots I have angular 14 project where I am using karma framework for unit testing and cypress for integration test. I have separate code coverage for karma unit test and cypress integration test and I have combined both code coverage json files but code coverage got dropped after merging. I think code coverage is taking delta of them.
Karma Unit test case coverage:-
Cypress Integration code coverage:-
Combined Code coverage:-
If you see above reports, I am expecting combine report should show 100 % code coverage for components/sym-ui-sedr-actions because I have covered the component in integration test but it was showing delta. Is there any solution?
Versions
window.coverage : yes
Is there .nyc_output folder? Is there .nyc_output/out.json file. -yes Do you have any custom NYC settings in package.json (nyc object) or in other [NYC config files] yes
Do you run Cypress tests in a Docker container? NO
Describe the bug If you see above reports, I am expecting combine report should show 100 % code coverage for components/sym-ui-sedr-actions because I have covered the component in integration test but it was showing delta. Is there any solution?
FYI I am using Istanbul for instrumenting code for karma as well as for cypress
Example .nycrc.json
Krama.config.js