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 d64e185
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ 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"),
},
// NOTE: The XML output by Mocha's xUnit reporter is actually in the
// JUnit style. I'm unsure how no one else has noticed this.
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 d64e185

Please sign in to comment.