Skip to content

Commit

Permalink
fix(@schematics/angular): remove reference to tsconfig.spec.json in t…
Browse files Browse the repository at this point in the history
…sconfig.json when minimal=true
  • Loading branch information
Amit775 authored and filipesilva committed Jul 20, 2020
1 parent 6c09023 commit a14c80a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export default function (options: ApplicationOptions): Rule {
]), MergeStrategy.Overwrite),
addTsConfigProjectReferences([
join(appDir, 'tsconfig.app.json'),
join(appDir, 'tsconfig.spec.json'),
... options.minimal ? [] : [join(appDir, 'tsconfig.spec.json')],
]),
options.minimal ? noop() : schematic('e2e', e2eOptions),
options.skipPackageJson ? noop() : addDependenciesToPackageJson(options),
Expand Down
11 changes: 11 additions & 0 deletions packages/schematics/angular/application/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ describe('Application Schematic', () => {
]);
});

it('minimal=true should add correct reference in tsconfig', async () => {
const options = { ...defaultOptions, minimal: true };
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
.toPromise();

const { references } = readJsonFile(tree, '/tsconfig.json');
expect(references).toEqual([
{ path: './projects/foo/tsconfig.app.json' },
]);
});

it('should set the prefix to app if none is set', async () => {
const options = { ...defaultOptions };

Expand Down

0 comments on commit a14c80a

Please sign in to comment.