Skip to content

Commit db3a64a

Browse files
authored
fix(2288): fix sonarqube setting (#29)
1 parent 1954617 commit db3a64a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

mocha.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"reporterEnabled": "spec, mocha-sonarqube-reporter",
3+
"mochaSonarqubeReporterReporterOptions": {
4+
"output": "./artifacts/report/test.xml"
5+
}
6+
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"pretest": "eslint .",
8-
"test": "mocha --recursive",
8+
"test": "nyc --report-dir ./artifacts/coverage --reporter=lcov mocha --reporter mocha-multi-reporters --reporter-options configFile=./mocha.config.json --recursive --timeout 4000 --retries 1 --exit --allow-uncaught true --color true",
99
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
1010
},
1111
"repository": {
@@ -36,7 +36,10 @@
3636
"chai": "^3.5.0",
3737
"eslint": "^4.19.1",
3838
"eslint-config-screwdriver": "^3.0.1",
39-
"mocha": "^8.1.2",
39+
"mocha": "^8.2.1",
40+
"mocha-multi-reporters": "^1.5.1",
41+
"mocha-sonarqube-reporter": "^1.0.2",
42+
"nyc": "^15.0.0",
4043
"mockery": "^2.0.0",
4144
"sinon": "^2.3.4"
4245
},

screwdriver.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ shared:
44
jobs:
55
main:
66
environment:
7-
SD_SONAR_OPTS: "-Dsonar.sources=index.js -Dsonar.javascript.lcov.reportPath=artifacts/coverage/lcov.info"
7+
SD_SONAR_OPTS: "-Dsonar.sources=index.js -Dsonar.tests=test -Dsonar.javascript.lcov.reportPaths=artifacts/coverage/lcov.info -Dsonar.testExecutionReportPaths=artifacts/report/test.xml"
88
requires: [~pr, ~commit]
99
steps:
1010
- install: npm install

0 commit comments

Comments
 (0)