aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorMalena Ebert <63863184+malena-ebert-sonarsource@users.noreply.github.com>2021-01-20 14:10:36 +0100
committersonartech <sonartech@sonarsource.com>2021-03-27 20:04:06 +0000
commit51d02b308638c31d6cd4c46125ce9155fc033ecf (patch)
treecbbe7ae91db91921bfa5a77f80cc7738ddc58693 /server/sonar-web
parent49612014375251ad6c77c9c0c8ec2e296532a16f (diff)
downloadsonarqube-51d02b308638c31d6cd4c46125ce9155fc033ecf.tar.gz
sonarqube-51d02b308638c31d6cd4c46125ce9155fc033ecf.zip
BUILD-857 Add junit report format for jest tests.
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/jest.config.js16
-rw-r--r--server/sonar-web/package.json3
-rw-r--r--server/sonar-web/yarn.lock25
3 files changed, 42 insertions, 2 deletions
diff --git a/server/sonar-web/jest.config.js b/server/sonar-web/jest.config.js
index 6b1d649224e..8dea5867955 100644
--- a/server/sonar-web/jest.config.js
+++ b/server/sonar-web/jest.config.js
@@ -26,5 +26,19 @@ module.exports = {
transform: {
'\\.js$': 'babel-jest',
'\\.(ts|tsx)$': 'ts-jest'
- }
+ },
+ reporters: [
+ 'default',
+ [
+ 'jest-junit',
+ {
+ outputDirectory: 'build/test-results/test-jest',
+ outputName: 'junit.xml',
+ ancestorSeparator: ' > ',
+ suiteNameTemplate: '{filename}',
+ classNameTemplate: '{classname}',
+ titleTemplate: '{title}'
+ }
+ ]
+ ]
};
diff --git a/server/sonar-web/package.json b/server/sonar-web/package.json
index 7a9939c4807..59ce83e4657 100644
--- a/server/sonar-web/package.json
+++ b/server/sonar-web/package.json
@@ -100,6 +100,7 @@
"glob-promise": "3.4.0",
"html-webpack-plugin": "3.2.0",
"jest": "25.1.0",
+ "jest-junit": "12.0.0",
"lint-staged": "7.3.0",
"lodash-webpack-plugin": "0.11.5",
"mini-css-extract-plugin": "0.9.0",
@@ -132,7 +133,7 @@
"lint-report": "eslint --ext js,ts,tsx -f json -o eslint-report.json src/main/js",
"ts-check": "tsc --noEmit",
"validate": "yarn lint && yarn ts-check && yarn format-check && yarn test",
- "validate-ci": "yarn lint-report && yarn test --coverage",
+ "validate-ci": "yarn lint-report && yarn test --coverage --ci",
"check-ci": "yarn ts-check && yarn format-check",
"precommit": "yarn ts-check && lint-staged"
},
diff --git a/server/sonar-web/yarn.lock b/server/sonar-web/yarn.lock
index 6b5120833ff..e7abaa60b53 100644
--- a/server/sonar-web/yarn.lock
+++ b/server/sonar-web/yarn.lock
@@ -7161,6 +7161,16 @@ jest-jasmine2@^25.1.0:
pretty-format "^25.1.0"
throat "^5.0.0"
+jest-junit@12.0.0:
+ version "12.0.0"
+ resolved "https://repox.jfrog.io/repox/api/npm/npm/jest-junit/-/jest-junit-12.0.0.tgz#3ebd4a6a84b50c4ab18323a8f7d9cceb9d845df6"
+ integrity sha1-Pr1KaoS1DEqxgyOo99nM652EXfY=
+ dependencies:
+ mkdirp "^1.0.4"
+ strip-ansi "^5.2.0"
+ uuid "^3.3.3"
+ xml "^1.0.1"
+
jest-leak-detector@^25.1.0:
version "25.1.0"
resolved "https://repox.jfrog.io/repox/api/npm/npm/jest-leak-detector/-/jest-leak-detector-25.1.0.tgz#ed6872d15aa1c72c0732d01bd073dacc7c38b5c6"
@@ -8224,6 +8234,11 @@ mkdirp@0.x, mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
dependencies:
minimist "0.0.8"
+mkdirp@^1.0.4:
+ version "1.0.4"
+ resolved "https://repox.jfrog.io/repox/api/npm/npm/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
+ integrity sha1-PrXtYmInVteaXw4qIh3+utdcL34=
+
moo@^0.4.3:
version "0.4.3"
resolved "https://repox.jfrog.io/repox/api/npm/npm/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e"
@@ -12260,6 +12275,11 @@ uuid@^3.0.1, uuid@^3.3.2:
resolved "https://repox.jfrog.io/repox/api/npm/npm/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
integrity sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=
+uuid@^3.3.3:
+ version "3.4.0"
+ resolved "https://repox.jfrog.io/repox/api/npm/npm/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
+ integrity sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=
+
v8-compile-cache@^2.0.3:
version "2.1.0"
resolved "https://repox.jfrog.io/repox/api/npm/npm/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e"
@@ -12660,6 +12680,11 @@ xml-name-validator@^3.0.0:
resolved "https://repox.jfrog.io/repox/api/npm/npm/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a"
integrity sha1-auc+Bt5NjG5H+fsYH3jWSK1FfGo=
+xml@^1.0.1:
+ version "1.0.1"
+ resolved "https://repox.jfrog.io/repox/api/npm/npm/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5"
+ integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU=
+
xmlchars@^2.1.1:
version "2.2.0"
resolved "https://repox.jfrog.io/repox/api/npm/npm/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"