diff --git a/karma.conf.js b/karma.conf.js index bec2016dea462..53f9608de5881 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -11,10 +11,22 @@ const karmaConfig = { exclude: [], // 'dots', 'progress', 'junit', 'growl', 'coverage', 'spec' - reporters: ['progress'], + reporters: ['spec', 'junit'], // enable the verbose reporter if you want to have more information of where/how specs fail // reporters: ['verbose'], + // this is to make a nice "spec failures" report in the jenkins build instead of having to look at the log output + junitReporter: { + outputDir: 'coverage-js', // just reusing same dir as the coverage stuff so it doesn't need its own .gitignore + outputFile: 'karma-test-results.xml', // if included, results will be saved as $outputDir/$browserName/$outputFile + useBrowserName: false, // add browser name to report and classes names + }, + specReporter: { + maxLogLines: 50, // limit number of lines logged per test + suppressErrorSummary: false, // print error summary + showSpecTiming: true, // print the time elapsed for each spec + }, + port: 9876, colors: true, diff --git a/package.json b/package.json index f38b1aafdc494..ac043682e069b 100644 --- a/package.json +++ b/package.json @@ -119,8 +119,10 @@ "karma-chrome-launcher": "^2.0.0", "karma-coverage-istanbul-reporter": "^1.3.0", "karma-firework-reporter": "~0.2.4", + "karma-junit-reporter": "^1.2.0", "karma-qunit": "~1.2.1", "karma-sourcemap-loader": "^0.3.7", + "karma-spec-reporter": "^0.0.32", "karma-verbose-reporter": "^0.0.6", "karma-webpack": "^2.0.5", "merge-stream": "^1.0.1", diff --git a/yarn.lock b/yarn.lock index cefd1e5cea4dc..2743c74fc8c92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5609,6 +5609,13 @@ karma-firework-reporter@~0.2.4: request "~2.33.0" rsvp "~3.0.3" +karma-junit-reporter@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz#4f9c40cedfb1a395f8aef876abf96189917c6396" + dependencies: + path-is-absolute "^1.0.0" + xmlbuilder "8.2.2" + karma-qunit@~1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/karma-qunit/-/karma-qunit-1.2.1.tgz#88252afd2127bc03b0cc31978ed6882b139f470a" @@ -5619,6 +5626,12 @@ karma-sourcemap-loader@^0.3.7: dependencies: graceful-fs "^4.1.2" +karma-spec-reporter@^0.0.32: + version "0.0.32" + resolved "https://registry.yarnpkg.com/karma-spec-reporter/-/karma-spec-reporter-0.0.32.tgz#2e9c7207ea726771260259f82becb543209e440a" + dependencies: + colors "^1.1.2" + karma-verbose-reporter@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/karma-verbose-reporter/-/karma-verbose-reporter-0.0.6.tgz#5909052451c607f02ac77c763791a2fe1251260c" @@ -9786,6 +9799,10 @@ xml2js@^0.4.10: sax ">=0.6.0" xmlbuilder "~9.0.1" +xmlbuilder@8.2.2: + version "8.2.2" + resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-8.2.2.tgz#69248673410b4ba42e1a6136551d2922335aa773" + xmlbuilder@^2.6.4: version "2.6.5" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-2.6.5.tgz#6ff7ad60fb72d22764f007a164b77f2bf1400526"