From eddad5698a8b8a9a3b1be47772c176318bb13883 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Wed, 31 Oct 2018 07:22:05 +0100 Subject: [PATCH] fix(@angular-devkit/schematics-cli): dryRun is not set by default when using a local collection Fixes #12815 --- .../angular_devkit/schematics_cli/bin/schematics.ts | 2 +- .../schematics_cli/bin/schematics_spec.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/angular_devkit/schematics_cli/bin/schematics.ts b/packages/angular_devkit/schematics_cli/bin/schematics.ts index 183ec79b3742..9fc6a39abd6f 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics.ts @@ -305,7 +305,7 @@ function parseArgs(args: string[] | undefined): minimist.ParsedArgs { }, default: { 'debug': null, - 'dry-run': null, + 'dryRun': null, }, '--': true, }); diff --git a/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts b/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts index 15e18be12d07..0bfee880cebb 100644 --- a/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts +++ b/packages/angular_devkit/schematics_cli/bin/schematics_spec.ts @@ -53,6 +53,16 @@ describe('schematics-cli binary', () => { expect(res).toEqual(0); }); + it('dry-run is default when debug mode', async () => { + const args = ['blank', 'foo', '--debug']; + const res = await main({ args, stdout, stderr }); + expect(stdout.lines).toMatch(/CREATE \/foo\/README.md/); + expect(stdout.lines).toMatch(/CREATE \/foo\/.gitignore/); + expect(stdout.lines).toMatch(/CREATE \/foo\/src\/foo\/index.ts/); + expect(stdout.lines).toMatch(/CREATE \/foo\/src\/foo\/index_spec.ts/); + expect(res).toEqual(0); + }); + it('error when no name is provided', async () => { const args = ['blank']; const res = await main({ args, stdout, stderr });