diff --git a/integration/ngcc/test.sh b/integration/ngcc/test.sh index 4c5fb4bb61..d4729a2dc3 100755 --- a/integration/ngcc/test.sh +++ b/integration/ngcc/test.sh @@ -42,10 +42,12 @@ function assertNotEquals { fi } - ngcc --help assertSucceeded "Expected 'ngcc --help' to succeed." +ngcc --unknown-option 2>&1 | grep 'Unknown arguments: unknown-option, unknownOption' +assertSucceeded "Expected ngcc to report bad option." + # node --inspect-brk $(npm bin)/ngcc -f esm2015 # Run ngcc and check it logged compilation output as expected ngcc | grep 'Compiling' diff --git a/packages/compiler-cli/ngcc/main-ngcc.ts b/packages/compiler-cli/ngcc/main-ngcc.ts index e3a7f7d2d7..bc385c8253 100644 --- a/packages/compiler-cli/ngcc/main-ngcc.ts +++ b/packages/compiler-cli/ngcc/main-ngcc.ts @@ -76,6 +76,7 @@ if (require.main === module) { describe: 'The lowest severity logging message that should be output.', choices: ['debug', 'info', 'warn', 'error'], }) + .strict() .help() .parse(args);