Skip to content

Commit

Permalink
Replace JUnit test output with xUnit
Browse files Browse the repository at this point in the history
So we can remove a vulnerable package.
  • Loading branch information
andyleejordan committed Sep 28, 2021
1 parent 24612a4 commit 57233ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .vsts-ci/templates/ci-general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ steps:
- task: PublishTestResults@2
displayName: Publish test results
inputs:
testRunner: JUnit
testRunner: xUnit
testResultsFiles: '**/test-results.xml'
condition: succeededOrFailed()
14 changes: 6 additions & 8 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,21 @@ export function run(): Promise<void> {
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
Expand Down

0 comments on commit 57233ec

Please sign in to comment.