diff --git a/.gitignore b/.gitignore index f366bb05..1bc03d93 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /dist-server /tmp /out-tsc +TESTS-Chrome*.xml # dependencies /node_modules diff --git a/karma.conf.js b/karma.conf.js index 0840f6ca..88567559 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -10,7 +10,8 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma'), + require('karma-junit-reporter') ], client:{ clearContext: false // leave Jasmine Spec Runner output visible in browser @@ -20,12 +21,24 @@ module.exports = function (config) { fixWebpackSourcePaths: true }, - reporters: ['progress', 'kjhtml'], + reporters: ['progress', 'kjhtml', 'junit'], port: 9876, colors: true, logLevel: config.LOG_INFO, autoWatch: true, browsers: ['Chrome'], - singleRun: false + singleRun: false, + + // the default configuration + junitReporter: { + outputDir: '', // results will be saved as $outputDir/$browserName.xml + outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: '', // suite will become the package name attribute in xml testsuite element + useBrowserName: true, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {}, // key value pair of properties to add to the section of the report + xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format + } }); }; diff --git a/package-lock.json b/package-lock.json index 3f676e1a..f253d328 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6350,6 +6350,24 @@ "karma-jasmine": "^1.0.2" } }, + "karma-junit-reporter": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz", + "integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=", + "dev": true, + "requires": { + "path-is-absolute": "^1.0.0", + "xmlbuilder": "8.2.2" + }, + "dependencies": { + "xmlbuilder": { + "version": "8.2.2", + "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", + "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=", + "dev": true + } + } + }, "karma-source-map-support": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.3.0.tgz", diff --git a/package.json b/package.json index e4d97537..aad4eab5 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "karma-coverage-istanbul-reporter": "~2.0.0", "karma-jasmine": "~1.1.0", "karma-jasmine-html-reporter": "^0.2.2", + "karma-junit-reporter": "^1.2.0", "protractor": "~5.3.0", "ts-node": "~5.0.1", "tslint": "~5.9.1",