From 006bdc28cee33b85ee3c6b4a770df7a920f0164a Mon Sep 17 00:00:00 2001 From: Mike Cooper Date: Wed, 27 May 2020 10:39:16 -0700 Subject: [PATCH] Make unhandled promise errors in build and tests fatal It is expected that this will cause CI to fail, since there are unfixed errors. Fixes #4 --- bin/build-schemas.ts | 5 +++++ test/normandy-arguments.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bin/build-schemas.ts b/bin/build-schemas.ts index 8d1d3f8..8f6c8ef 100755 --- a/bin/build-schemas.ts +++ b/bin/build-schemas.ts @@ -95,4 +95,9 @@ async function* walk( } } +process.on("unhandledRejection", (reason, promise) => { + console.log("Unhandled Reject at:", promise, "reason:", reason); + process.exit(1); +}); + main(); diff --git a/test/normandy-arguments.ts b/test/normandy-arguments.ts index 98eb12c..ea52c14 100755 --- a/test/normandy-arguments.ts +++ b/test/normandy-arguments.ts @@ -48,4 +48,9 @@ function convertActionNameToTypeName(actionName: string): string { return typeName + "Arguments"; } +process.on("unhandledRejection", (reason, promise) => { + console.log("Unhandled promise rejection:", reason); + process.exit(1); +}); + main();