export async function run()

in src/index.ts [10:45]


export async function run(): Promise<void> {
    try {
        const oldConfigSuffix = getOldConfigArg() ? '_oldConfig' : '';
        const fileName = `${process.platform}_model-${getModelArg()}_Node-${process.version}${oldConfigSuffix}.xml`;
        const options: Mocha.MochaOptions = {
            color: true,
            timeout: defaultTimeout,
            reporter: 'mocha-multi-reporters',
            reporterOptions: {
                reporterEnabled: 'spec, mocha-junit-reporter',
                mochaJunitReporterReporterOptions: {
                    mochaFile: path.resolve(__dirname, '..', 'e2e-test-results', fileName),
                },
            },
        };

        addEnvVarsToMochaOptions(options);

        const mocha = new Mocha(options);

        const files: string[] = await globby('**/**.test.js', { cwd: __dirname });

        files.forEach((f) => mocha.addFile(path.resolve(__dirname, f)));

        const failures = await new Promise<number>((resolve) => mocha.run(resolve));
        if (failures > 0) {
            throw new Error(`${failures} tests failed.`);
        }
        console.log('Test run succeeded');
        process.exit(0);
    } catch (err) {
        console.error(err);
        console.error('Test run failed');
        process.exit(1);
    }
}