feat(cli): should exit process when test failed

This commit is contained in:
陈嘉涵 2019-12-19 14:18:54 +08:00
parent 46a7aefc65
commit 87260de98a

View File

@ -17,5 +17,17 @@ export function test(command: any) {
clearCache: command.clearCache
} as any;
runCLI(config, [ROOT]);
runCLI(config, [ROOT])
.then(response => {
if (!response.results.success && !command.watch) {
process.exit(1);
}
})
.catch(err => {
console.log(err);
if (!command.watch) {
process.exit(1);
}
});
}