Hi Community
When using a node.js project to get code coverage using sonarcloud is 0% and is used from Azure Devops. Test framework used is Mocha and Chai.
Using the below settings for generation.
Sonar XXXX Settings
sonar.sources=./src
sonar.language=js
sonar.sourceEncoding=UTF-8
sonar.typescript.lcov.reportPaths=/coverage/lcov.info
sonar.host.url=https://sonarcloud.io
sonar.project.monorepo.enabled=true
Also using the below blocks in the Azure pipeline yamls:
- task: PublishCodeCoverageResults@1
condition: succeededOrFailed()
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: “coverage/cobertura-coverage.xml”
failIfCoverageEmpty: false
displayName: Publish code coverage report
- task: SonarCloudAnalyze@1
displayName: Sonar Code analysis
- task: SonarCloudPublish@1
displayName: Sonar Publish
inputs:
pollingTimeoutSec: ‘300’
Any help is appreciated.