diff --git a/.gitignore b/.gitignore index 138e96d05..92e9362d8 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /deploy.sh /.vs/ yarn-error.log* +/junit.xml /static/ /static-test/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0e120f5ab..6248eb152 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,6 +58,7 @@ jest: - "yarn.lock" artifacts: reports: + junit: junit.xml coverage_report: coverage_format: cobertura path: .coverage/cobertura-coverage.xml diff --git a/jest.config.js b/jest.config.js index 8796e5595..924d6f766 100644 --- a/jest.config.js +++ b/jest.config.js @@ -28,6 +28,7 @@ module.exports = { ], 'coverageDirectory': '/.coverage/', 'coverageReporters': ['html', 'text', 'text-summary', 'cobertura'], + 'reporters': ['jest-junit'], 'moduleDirectories': [ '/node_modules', '/app', diff --git a/package.json b/package.json index dbced84ea..d5dc14f33 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "jsdoc": "npx jsdoc -c jsdoc.conf.js", "manage:translations": "node ./webpack/translationRunner.js", "test": "npx cross-env NODE_ENV=test npx jest", - "test:coverage": "npx jest --coverage", + "test:coverage": "${npm_execpath} run test --coverage", "test:all": "${npm_execpath} run test:coverage && ${npm_execpath} run lint", "lint": "${npm_execpath} run lint:js && ${npm_execpath} run lint:sass", "lint:js": "npx eslint --ext .js,.jsx,.ts,.tsx . --cache", @@ -219,6 +219,7 @@ "fake-indexeddb": "^3.1.7", "husky": "^7.0.2", "jest": "^27.5.1", + "jest-junit": "^13.2.0", "lint-staged": ">=10", "raf": "^3.4.1", "react-intl-translations-manager": "^5.0.3", diff --git a/yarn.lock b/yarn.lock index fbdd06355..99973c815 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6778,6 +6778,16 @@ jest-jasmine2@^27.5.1: pretty-format "^27.5.1" throat "^6.0.1" +jest-junit@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/jest-junit/-/jest-junit-13.2.0.tgz#66eeb86429aafac8c1745a70f44ace185aacb943" + integrity sha512-B0XNlotl1rdsvFZkFfoa19mc634+rrd8E4Sskb92Bb8MmSXeWV9XJGUyctunZS1W410uAxcyYuPUGVnbcOH8cg== + dependencies: + mkdirp "^1.0.4" + strip-ansi "^6.0.1" + uuid "^8.3.2" + xml "^1.0.1" + jest-leak-detector@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-27.5.1.tgz#6ec9d54c3579dd6e3e66d70e3498adf80fde3fb8" @@ -11312,6 +11322,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw== + xmlchars@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb"