Skip to content

Commit a14c80a

Browse files
Amit775filipesilva
authored andcommitted
fix(@schematics/angular): remove reference to tsconfig.spec.json in tsconfig.json when minimal=true
1 parent 6c09023 commit a14c80a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export default function (options: ApplicationOptions): Rule {
418418
]), MergeStrategy.Overwrite),
419419
addTsConfigProjectReferences([
420420
join(appDir, 'tsconfig.app.json'),
421-
join(appDir, 'tsconfig.spec.json'),
421+
... options.minimal ? [] : [join(appDir, 'tsconfig.spec.json')],
422422
]),
423423
options.minimal ? noop() : schematic('e2e', e2eOptions),
424424
options.skipPackageJson ? noop() : addDependenciesToPackageJson(options),

packages/schematics/angular/application/index_spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,17 @@ describe('Application Schematic', () => {
9191
]);
9292
});
9393

94+
it('minimal=true should add correct reference in tsconfig', async () => {
95+
const options = { ...defaultOptions, minimal: true };
96+
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
97+
.toPromise();
98+
99+
const { references } = readJsonFile(tree, '/tsconfig.json');
100+
expect(references).toEqual([
101+
{ path: './projects/foo/tsconfig.app.json' },
102+
]);
103+
});
104+
94105
it('should set the prefix to app if none is set', async () => {
95106
const options = { ...defaultOptions };
96107

0 commit comments

Comments
 (0)