Skip to content

Commit eddad56

Browse files
alan-agius4alexeagle
authored andcommitted
fix(@angular-devkit/schematics-cli): dryRun is not set by default when using a local collection
Fixes #12815
1 parent 524769b commit eddad56

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/angular_devkit/schematics_cli/bin/schematics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ function parseArgs(args: string[] | undefined): minimist.ParsedArgs {
305305
},
306306
default: {
307307
'debug': null,
308-
'dry-run': null,
308+
'dryRun': null,
309309
},
310310
'--': true,
311311
});

packages/angular_devkit/schematics_cli/bin/schematics_spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ describe('schematics-cli binary', () => {
5353
expect(res).toEqual(0);
5454
});
5555

56+
it('dry-run is default when debug mode', async () => {
57+
const args = ['blank', 'foo', '--debug'];
58+
const res = await main({ args, stdout, stderr });
59+
expect(stdout.lines).toMatch(/CREATE \/foo\/README.md/);
60+
expect(stdout.lines).toMatch(/CREATE \/foo\/.gitignore/);
61+
expect(stdout.lines).toMatch(/CREATE \/foo\/src\/foo\/index.ts/);
62+
expect(stdout.lines).toMatch(/CREATE \/foo\/src\/foo\/index_spec.ts/);
63+
expect(res).toEqual(0);
64+
});
65+
5666
it('error when no name is provided', async () => {
5767
const args = ['blank'];
5868
const res = await main({ args, stdout, stderr });

0 commit comments

Comments
 (0)