Skip to content

Commit f4f5e0b

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

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
@@ -383,7 +383,7 @@ export default function (options: ApplicationOptions): Rule {
383383
]), MergeStrategy.Overwrite),
384384
addTsConfigProjectReferences([
385385
join(appDir, 'tsconfig.app.json'),
386-
join(appDir, 'tsconfig.spec.json'),
386+
... options.minimal ? [] : [join(appDir, 'tsconfig.spec.json')],
387387
]),
388388
options.minimal ? noop() : schematic('e2e', e2eOptions),
389389
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)