core/scripts/module-jest.ts

24 lines
653 B
TypeScript

import { argv } from '../packages/core-common/src/node/cli';
import { runTest } from './jest/runTest';
const modulePath: string | undefined = argv.module as any;
if (!modulePath) {
console.error(
'The module name must be provided using the `--module={folder}` parameter, eg: yarn run test:module --module=editor',
);
process.exit(1);
}
runTest(modulePath, {
project: argv.project as string,
runInBand: argv.runInBand as boolean,
}).then((v) => {
console.log('Test Result:', v.results.success ? 'PASS' : 'FAIL');
// 如果三秒后进程还没退出
setTimeout(() => {
process.exit(v.results.success ? 0 : 1);
}, 3000);
});