Skip to content

Commit 57233ec

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

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

.vsts-ci/templates/ci-general.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ steps:
6464
- task: PublishTestResults@2
6565
displayName: Publish test results
6666
inputs:
67-
testRunner: JUnit
67+
testRunner: xUnit
6868
testResultsFiles: '**/test-results.xml'
6969
condition: succeededOrFailed()

test/index.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,21 @@ 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+
reporterEnabled: "spec, xunit",
20+
xunitReporterOptions: {
21+
output: path.join(__dirname, "..", "..", "test-results.xml"),
22+
}
2323
},
2424
});
2525

26-
const testsRoot = path.resolve(__dirname, "..");
27-
2826
return new Promise((c, e) => {
29-
glob("**/**.test.js", { cwd: testsRoot }, (err, files) => {
27+
glob("**/**.test.js", { cwd: __dirname }, (err, files) => {
3028
if (err) {
3129
return e(err);
3230
}
3331

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

3735
try {
3836
// Run the mocha test

0 commit comments

Comments
 (0)