Skip to content

Commit d64e185

Browse files
committed
Replace JUnit test output with xUnit
So we can remove a vulnerable package.
1 parent 24612a4 commit d64e185

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/index.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ export function run(): Promise<void> {
1616
reporter: "mocha-multi-reporters",
1717
timeout: 5000,
1818
reporterOptions: {
19-
reporterEnabled: "spec, mocha-junit-reporter",
20-
mochaJunitReporterReporterOptions: {
21-
mochaFile: path.join(__dirname, "..", "..", "test-results.xml"),
22-
},
19+
// NOTE: The XML output by Mocha's xUnit reporter is actually in the
20+
// JUnit style. I'm unsure how no one else has noticed this.
21+
reporterEnabled: "spec, xunit",
22+
xunitReporterOptions: {
23+
output: path.join(__dirname, "..", "..", "test-results.xml"),
24+
}
2325
},
2426
});
2527

26-
const testsRoot = path.resolve(__dirname, "..");
27-
2828
return new Promise((c, e) => {
29-
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
29+
glob("**/**.test.js", { cwd: __dirname }, (err, files) => {
3030
if (err) {
3131
return e(err);
3232
}
3333

3434
// Add files to the test suite
35-
files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
35+
files.forEach(f => mocha.addFile(path.resolve(__dirname, f)));
3636

3737
try {
3838
// Run the mocha test

0 commit comments

Comments
 (0)