User not able to see j-unit test cases on Sonarqube

Template for a good bug report, formatted with Markdown:

  • Versions used (SonarQube, Scanner, Plugin, and any relevant extension)
  • Error observed (wrap logs/code around triple quote ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround
  • Scanner command used when applicable (private details masked)
  • In case of SonarCloud:
    • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
    • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI, Jenkins, other)

Sonarqube version: 8.9.2 Community edition

sonar.projectKey=
sonar.projectName=
sonar.projectVersion=1.0
sonar.sourceEncoding=
sonar.sources=
sonar.java.binaries=

TESTS

sonar.tests=dms-fd-monthlystatement-repo/src/test
sonar.coverage.jacoco.xmlReportPaths=dms-fd-monthlystatement-repo/target/site/jacoco/jacoco.xml
sonar.junit.reportsPath=dms-fd-monthlystatement-repo/target/surefire-reports/TEST-*.xml

sonar.language=js

Hey there.

sonar.junit.reportsPath cannot be used for Javascript/Typescript. it can only be used for Java and Kotlin.

As noted in the documentation, you must use a test execution reporter that outputs information in the Generic Execution Data format and pass those reports to sonar.testExecutionReportPaths .

Javascript and Typescript

Analysis parameter Description
You can use jest-sonar-reporter or karma-sonarqube-unit-reporter to create reports in the Generic Execution Data format. Both packages are available on npm.