Skip to content

Commit 2e017b8

Browse files
committed
Hardcode xunit reporter output file into failed tests reporter
1 parent bad002c commit 2e017b8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Jakefile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ function runConsoleTests(defaultReporter, runInParallel) {
567567
var startTime = Travis.mark();
568568
var args = [];
569569
args.push("-R", "scripts/failed-tests");
570-
args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + (reporter === "xunit" ? ",output=TEST-results.xml" : "") + '"');
570+
args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + '"');
571571
if (tests) args.push("-g", `"${tests}"`);
572572
args.push(colors ? "--colors" : "--no-colors");
573573
if (bail) args.push("--bail");

scripts/failed-tests.js

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class FailedTestsReporter extends Mocha.reporters.Base {
4646
}
4747

4848
const newOptions = Object.assign({}, options, { reporterOptions: reporterOptions.reporterOptions || {} });
49+
if (reporterOptions.reporter === "xunit") {
50+
newOptions.reporterOptions.output = "TEST-results.xml";
51+
}
4952
this.reporter = new reporter(runner, newOptions);
5053
}
5154

0 commit comments

Comments
 (0)