Code coverage got dropped while merging locv files


I have a React based project. For testing the project i am using Cypress . Am able to generate around 70% coverage using Cypress in Sonar. I have added few unit test using jest for covering some utils function and some other component which is not covered using Cypress. Overall coverage in jest is around 20%.

I have used Comma-delimited list of paths to LCOV coverage report files (Cypress and Jest) to merge both.But the final coverage dropped to 48%.

npm package version :

    "sonar-scanner": "^3.1.0",
     "sonarqube-scanner": "^2.5.0",
     "cypress": "^4.12.1",
     "jest": "^22.0.3",

Any help is highly appreciated!

I have check and found jest and cypress is using different version of istanbul-lib-coverage package to generate coverage. Does this have any effect on final lcov file ?

I have the same issue. Cypress coverage shows 70 % and jest’s is 6% and when merge it dropped to 55%. I think it’s incorrect
My project is typescript so I tried with this properties sonar.typescript.lcov.reportPaths and sonar.javascript.lcov.reportPaths but for both cases it’s just 55%. But it might help you if yours is also typescript