diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts index cac60c23177b..351b5da2043b 100644 --- a/packages/schematics/angular/application/index.ts +++ b/packages/schematics/angular/application/index.ts @@ -121,7 +121,7 @@ export default function (options: ApplicationOptions): Rule { ), mergeWith( apply(url('./files/common-files'), [ - options.minimal + options.skipTests || options.minimal ? filter((path) => !path.endsWith('tsconfig.spec.json.template')) : noop(), componentOptions.inlineTemplate diff --git a/packages/schematics/angular/application/index_spec.ts b/packages/schematics/angular/application/index_spec.ts index 7f86e245553a..ec726343b8b6 100644 --- a/packages/schematics/angular/application/index_spec.ts +++ b/packages/schematics/angular/application/index_spec.ts @@ -157,6 +157,17 @@ describe('Application Schematic', () => { ); }); + it('should not create tsconfig.spec.json with "skipTests" enabled', async () => { + const tree = await schematicRunner.runSchematic( + 'application', + { ...defaultOptions, skipTests: true }, + workspaceTree, + ); + + expect(tree.exists('/projects/foo/tsconfig.app.json')).toBeTrue(); + expect(tree.exists('/projects/foo/tsconfig.spec.json')).toBeFalse(); + }); + it('should not add spec project reference in the root tsconfig.json with "minimal" enabled', async () => { const tree = await schematicRunner.runSchematic( 'application',