diff --git a/Jakefile.js b/Jakefile.js index 44e98bc6b4f..6ecb67ab9ce 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -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"); diff --git a/scripts/failed-tests.js b/scripts/failed-tests.js index 46baa3201ec..66463e56c7c 100644 --- a/scripts/failed-tests.js +++ b/scripts/failed-tests.js @@ -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); }