diff --git a/packages/e2e-test/src/commands/run.ts b/packages/e2e-test/src/commands/run.ts index fa0051a4cb..441dd9b9fe 100644 --- a/packages/e2e-test/src/commands/run.ts +++ b/packages/e2e-test/src/commands/run.ts @@ -373,11 +373,7 @@ async function testAppServe(pluginName: string, appDir: string) { } finally { // Kill entire process group, otherwise we'll end up with hanging serve processes await new Promise((res, rej) => { - if (!startApp.pid) { - res(); - return; - } - killTree(startApp.pid, err => (err ? rej(err) : res())); + killTree(startApp.pid!, err => (err ? rej(err) : res())); }); } @@ -482,11 +478,7 @@ async function testBackendStart(appDir: string, isPostgres: boolean) { print('Stopping the child process'); // Kill entire process group, otherwise we'll end up with hanging serve processes await new Promise((res, rej) => { - if (!child.pid) { - res(); - return; - } - killTree(child.pid, err => (err ? rej(err) : res())); + killTree(child.pid!, err => (err ? rej(err) : res())); }); }