From 6069812fcf87672dd85f822906e62d1d6acab257 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 28 Mar 2016 23:35:36 +0100 Subject: [PATCH] Create Junit reports from karma --- .gitignore | 3 +++ karma.conf.js | 9 ++++++--- package.json | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 949e21b82b..8fdaf5903f 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # version file and tarball created by 'npm pack' /git-revision.txt /matrix-react-sdk-*.tgz + +# test reports created by karma +/karma-reports diff --git a/karma.conf.js b/karma.conf.js index 4604e1355a..7a8831635b 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -9,8 +9,7 @@ var path = require('path'); * from node_modules. * * TODO: - * - can we run one test at a time - * - write junit out + * - can we run one test at a time? */ process.env.PHANTOMJS_BIN = 'node_modules/.bin/phantomjs'; @@ -43,7 +42,7 @@ module.exports = function (config) { // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['progress', 'junit'], // web server port port: 9876, @@ -76,6 +75,10 @@ module.exports = function (config) { // how many browser should be started simultaneous concurrency: Infinity, + junitReporter: { + outputDir: 'karma-reports', + }, + webpack: { module: { loaders: [ diff --git a/package.json b/package.json index 186ed6681e..1f3b2d4962 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "karma": "^0.13.22", "karma-chrome-launcher": "^0.2.3", "karma-cli": "^0.1.2", + "karma-junit-reporter": "^0.4.1", "karma-mocha": "^0.2.2", "karma-phantomjs-launcher": "^1.0.0", "karma-sourcemap-loader": "^0.3.7",