diff --git a/.vsts-ci/templates/ci-general.yml b/.vsts-ci/templates/ci-general.yml index 1419e4d3fa..d9446f47f7 100644 --- a/.vsts-ci/templates/ci-general.yml +++ b/.vsts-ci/templates/ci-general.yml @@ -64,6 +64,6 @@ steps: - task: PublishTestResults@2 displayName: Publish test results inputs: - testRunner: JUnit + testRunner: xUnit testResultsFiles: '**/test-results.xml' condition: succeededOrFailed() diff --git a/test/index.ts b/test/index.ts index 0aa85775ef..87297c3283 100644 --- a/test/index.ts +++ b/test/index.ts @@ -16,23 +16,21 @@ export function run(): Promise { reporter: "mocha-multi-reporters", timeout: 5000, reporterOptions: { - reporterEnabled: "spec, mocha-junit-reporter", - mochaJunitReporterReporterOptions: { - mochaFile: path.join(__dirname, "..", "..", "test-results.xml"), - }, + reporterEnabled: "spec, xunit", + xunitReporterOptions: { + output: path.join(__dirname, "..", "..", "test-results.xml"), + } }, }); - const testsRoot = path.resolve(__dirname, ".."); - return new Promise((c, e) => { - glob("**/**.test.js", { cwd: testsRoot }, (err, files) => { + glob("**/**.test.js", { cwd: __dirname }, (err, files) => { if (err) { return e(err); } // Add files to the test suite - files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); + files.forEach(f => mocha.addFile(path.resolve(__dirname, f))); try { // Run the mocha test