script/cli-e2e-test: error out if child exits early

This commit is contained in:
Patrik Oldsberg
2020-03-18 15:51:11 +01:00
parent 79d2ba5bc7
commit a60bfc31d9
+3
View File
@@ -46,6 +46,9 @@ function print(msg) {
}
async function waitForExit(child) {
if (child.exitCode !== null) {
throw new Error(`Child already exited with code ${child.exitCode}`);
}
await new Promise((resolve, reject) =>
child.once('exit', code => {
if (code) {