Skip to content

Commit 21f73e4

Browse files
committed
test: catch and log all errors include test setup
1 parent 82649bc commit 21f73e4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/legacy-cli/e2e_runner.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ Promise.all([findFreePort(), findFreePort()])
181181
} else {
182182
console.log(colors.green('Done.'));
183183
}
184+
185+
process.exitCode = 0;
184186
} catch (err) {
185187
if (err instanceof Error) {
186188
console.log('\n');
@@ -202,16 +204,16 @@ Promise.all([findFreePort(), findFreePort()])
202204
}
203205
}
204206

205-
throw err;
207+
process.exitCode = 1;
206208
} finally {
207209
registryProcess.kill();
208210
secureRegistryProcess.kill();
209211
}
210212
})
211-
.then(
212-
() => process.exit(0),
213-
() => process.exit(1),
214-
);
213+
.catch((err) => {
214+
console.error(colors.red(`Unkown Error: ${err}`));
215+
process.exitCode = 1;
216+
});
215217

216218
async function runSteps(
217219
run: (name: string) => Promise<void> | void,

0 commit comments

Comments
 (0)