[engineering] ensure typescript integration tests emit junit reports

not sure if this was intentional but it seems like an oversight
This commit is contained in:
Aman Karmani
2025-07-01 16:45:28 -07:00
parent 4f5f4d901e
commit 8b7988cffd

View File

@@ -15,14 +15,28 @@
// to report the results back to the caller. When the tests are finished, return
// a possible error to the callback or null if none.
const path = require('path');
const testRunner = require('../../../../../test/integration/electron/testrunner');
// You can directly control Mocha options by uncommenting the following lines
// See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info
testRunner.configure({
ui: 'tdd', // the TDD UI is being used in extension.test.ts (suite, test, etc.)
const suite = 'Integration TypeScript Tests';
const options: import('mocha').MochaOptions = {
ui: 'tdd',
color: true,
timeout: 60000,
});
timeout: 60000
};
if (process.env.BUILD_ARTIFACTSTAGINGDIRECTORY) {
options.reporter = 'mocha-multi-reporters';
options.reporterOptions = {
reporterEnabled: 'spec, mocha-junit-reporter',
mochaJunitReporterReporterOptions: {
testsuitesTitle: `${suite} ${process.platform}`,
mochaFile: path.join(process.env.BUILD_ARTIFACTSTAGINGDIRECTORY, `test-results/${process.platform}-${process.arch}-${suite.toLowerCase().replace(/[^\w]/g, '-')}-results.xml`)
}
};
}
testRunner.configure(options);
export = testRunner;