cli: never treat success as a failure in e2e test

This commit is contained in:
Patrik Oldsberg
2020-07-02 19:00:45 +02:00
parent c499656a69
commit ab6385cfb1
2 changed files with 9 additions and 7 deletions
+9 -1
View File
@@ -221,6 +221,7 @@ async function testAppServe(pluginName, appDir) {
});
Browser.localhost('localhost', 3000);
let successful = false;
try {
const browser = new Browser();
@@ -232,6 +233,7 @@ async function testAppServe(pluginName, appDir) {
);
print('Both App and Plugin loaded correctly');
successful = true;
} catch (error) {
throw new Error(`App serve test failed, ${error}`);
} finally {
@@ -239,7 +241,13 @@ async function testAppServe(pluginName, appDir) {
killTree(startApp.pid);
}
await waitForExit(startApp);
try {
await waitForExit(startApp);
} catch (error) {
if (!successful) {
throw error;
}
}
}
process.on('unhandledRejection', handleError);
-6
View File
@@ -38,12 +38,6 @@ function spawnPiped(cmd, options) {
...options,
});
child.on('error', handleError);
child.on('exit', code => {
if (code) {
print(`Child '${cmd.join(' ')}' exited with code ${code}`);
process.exit(code);
}
});
const logPrefix = cmd.map(s => s.replace(/.+\//, '')).join(' ');
child.stdout.on(