diff --git a/tests/legacy-cli/e2e/tests/commands/ng-generate-collection.ts b/tests/legacy-cli/e2e/tests/commands/ng-generate-collection.ts new file mode 100644 index 000000000000..8d4a37bc0a4a --- /dev/null +++ b/tests/legacy-cli/e2e/tests/commands/ng-generate-collection.ts @@ -0,0 +1,19 @@ +import { execAndWaitForOutputToMatch } from '../../utils/process'; + +export default async function () { + const currentDirectory = process.cwd(); + + try { + process.chdir('..'); + + // The below is a way to validate that the `--collection` option is being considered. + await execAndWaitForOutputToMatch( + 'ng', + ['g', '--collection', 'invalid-schematic'], + /Collection "invalid-schematic" cannot be resolved/, + ); + } finally { + // Change directory back + process.chdir(currentDirectory); + } +}