Merge pull request #253528 from tmm1/tmm1/ts-integration-results

[engineering] ensure typescript integration tests emit junit reports
This commit is contained in:
Matt Bierner
2025-07-10 21:14:52 -07:00
committed by GitHub
@@ -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;