From 6777427cc6450a0b431c6889c8e93c1496b91379 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 5 Jan 2018 22:28:19 +0200 Subject: [PATCH] build: fix builds not failing with compilation errors in unit tests (#9248) Fixes the CI continuing to run even though it failed to compile, due to a couple of promises that weren't rejecting properly. This should avoids things like #9073 slipping through. --- tools/package-tools/build-package.ts | 1 + tools/package-tools/compile-entry-point.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/tools/package-tools/build-package.ts b/tools/package-tools/build-package.ts index a75402664be..4d99493704c 100644 --- a/tools/package-tools/build-package.ts +++ b/tools/package-tools/build-package.ts @@ -107,6 +107,7 @@ export class BuildPackage { return ngcCompile(['-p', entryPointTsconfigPath]).catch(() => { const error = red(`Failed to compile ${secondaryEntryPoint} using ${entryPointTsconfigPath}`); console.error(error); + return Promise.reject(error); }); } diff --git a/tools/package-tools/compile-entry-point.ts b/tools/package-tools/compile-entry-point.ts index 0676eeb1745..96eb287ff8b 100644 --- a/tools/package-tools/compile-entry-point.ts +++ b/tools/package-tools/compile-entry-point.ts @@ -22,6 +22,7 @@ export async function compileEntryPoint(buildPackage: BuildPackage, tsconfigName return ngcCompile(ngcFlags).catch(() => { const error = red(`Failed to compile ${secondaryEntryPoint} using ${entryPointTsconfigPath}`); console.error(error); + return Promise.reject(error); }); }