Hardcode xunit reporter output file into failed tests reporter

This commit is contained in:
Wesley Wigham 2018-08-06 14:09:41 -07:00
parent bad002cfb7
commit 2e017b8ce1
No known key found for this signature in database
GPG Key ID: D59F87F60C5400C9
2 changed files with 4 additions and 1 deletions

View File

@ -567,7 +567,7 @@ function runConsoleTests(defaultReporter, runInParallel) {
var startTime = Travis.mark();
var args = [];
args.push("-R", "scripts/failed-tests");
args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + (reporter === "xunit" ? ",output=TEST-results.xml" : "") + '"');
args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + '"');
if (tests) args.push("-g", `"${tests}"`);
args.push(colors ? "--colors" : "--no-colors");
if (bail) args.push("--bail");

View File

@ -46,6 +46,9 @@ class FailedTestsReporter extends Mocha.reporters.Base {
}
const newOptions = Object.assign({}, options, { reporterOptions: reporterOptions.reporterOptions || {} });
if (reporterOptions.reporter === "xunit") {
newOptions.reporterOptions.output = "TEST-results.xml";
}
this.reporter = new reporter(runner, newOptions);
}