Skip to content

Commit

Permalink
fix(@angular-devkit/schematics-cli): dryRun is not set by default whe…
Browse files Browse the repository at this point in the history
…n using a local collection

Fixes #12815
  • Loading branch information
alan-agius4 authored and alexeagle committed Nov 1, 2018
1 parent 524769b commit eddad56
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/angular_devkit/schematics_cli/bin/schematics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ function parseArgs(args: string[] | undefined): minimist.ParsedArgs {
},
default: {
'debug': null,
'dry-run': null,
'dryRun': null,
},
'--': true,
});
Expand Down
10 changes: 10 additions & 0 deletions packages/angular_devkit/schematics_cli/bin/schematics_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit eddad56

Please sign in to comment.