【发布时间】:2018-11-08 03:39:22
【问题描述】:
我有一个包含 Java 和 Javascript 模块的 maven 项目。 我在 SonarQube 的测试报告中没有看到 Javascript 单元测试文件,而只有 Java 单元测试文件。 覆盖率报告
在coverage_reports 文件夹中,我有由 Jest 创建的 cobertura-coverage.xml。
这个sonar.javascript.jstest.reportPaths 是否仍在使用或已被其他配置替换。我们在服务器上使用 Sonarqube 6.7。
编辑:
为了让其他人知道,我使用jest-sonar-reporter 和测试脚本作为
"test": "cross-env CI=true NODE_PATH=./src react-scripts test --env=jsdom --coverage --no-cache -u --testResultsProcessor jest-sonar-reporter"
这创建了一个我这样使用的测试报告 xml 文件
<sonar.tests>src/test</sonar.tests>
<sonar.testExecutionReportPaths>path/to/test-report.xml</sonar.testExecutionReportPaths>
<sonar.javascript.lcov.reportPaths>path/to/lcov.info</sonar.javascript.lcov.reportPaths>
【问题讨论】:
-
“我在 SonarQube 的测试报告中没有看到 Javascript 单元测试文件”是什么意思?
标签: javascript sonarqube sonarqube-scan