Code Coverage using Sonarcloud is 0% used in Azure Devops in a node.js Project

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.

Hi @mnilesh , as you can see in our documentation about test coverage, the correct parameter name should be sonar.javascript.lcov.reportPaths. The property name you used was considered deprecated, and recently dropped, on August 16th.

If you could replace it with the correct parameter, your coverage information should come back. Please let us know if you need anything else.

Best regards,
Antonio