From d948281354224960007326c614334f3931973869 Mon Sep 17 00:00:00 2001 From: Mathias Rasmussen Date: Mon, 3 Jan 2022 23:11:30 +0100 Subject: [PATCH] Add junit test reports --- package.json | 1 + test/karma.conf.js | 5 ++++- yarn.lock | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 94c46d0c..7bec7f92 100644 --- a/package.json +++ b/package.json @@ -106,6 +106,7 @@ "karma": "^4.0.1", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.0.0", + "karma-junit-reporter": "^2.0.1", "karma-mocha": "^1.3.0", "karma-rollup-preprocessor": "^7.0.5", "karma-sinon": "^1.0.5", diff --git a/test/karma.conf.js b/test/karma.conf.js index 547a8e08..f937d992 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -6,7 +6,7 @@ const NODE_ENV = process.env.NODE_ENV || 'test'; module.exports = function(config) { config.set({ - reporters: ['tfs', 'spec'], + reporters: ['tfs', 'spec','junit'], basePath: '../', frameworks: ['mocha', 'chai', 'sinon-chai'], files: [ @@ -34,6 +34,9 @@ module.exports = function(config) { outputDir: 'testresults', outputFile: 'test_results.xml', }, + junitReporter: { + outputDir: 'test-results-junit' + }, singleRun: true, preprocessors: { './src/js/localization.js': ['rollup'], diff --git a/yarn.lock b/yarn.lock index 6eaf3d6f..8d55bd55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5453,6 +5453,14 @@ karma-chrome-launcher@^3.0.0: dependencies: which "^1.2.1" +karma-junit-reporter@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-2.0.1.tgz#d34eef7f0b2fd064e0896954e8851a90cf14c8f3" + integrity sha512-VtcGfE0JE4OE1wn0LK8xxDKaTP7slN8DO3I+4xg6gAi1IoAHAXOJ1V9G/y45Xg6sxdxPOR3THCFtDlAfBo9Afw== + dependencies: + path-is-absolute "^1.0.0" + xmlbuilder "12.0.0" + karma-mocha@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/karma-mocha/-/karma-mocha-1.3.0.tgz#eeaac7ffc0e201eb63c467440d2b69c7cf3778bf" @@ -10131,6 +10139,11 @@ xdg-basedir@^3.0.0: resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-3.0.0.tgz#496b2cc109eca8dbacfe2dc72b603c17c5870ad4" integrity sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ= +xmlbuilder@12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-12.0.0.tgz#e2ed675e06834a089ddfb84db96e2c2b03f78c1a" + integrity sha512-lMo8DJ8u6JRWp0/Y4XLa/atVDr75H9litKlb2E5j3V3MesoL50EBgZDWoLT3F/LztVnG67GjPXLZpqcky/UMnQ== + xmlbuilder@^9.0.0, xmlbuilder@^9.0.7: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d"