diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts index 656c45e76145..d4025145be4d 100644 --- a/packages/schematics/angular/application/index.ts +++ b/packages/schematics/angular/application/index.ts @@ -324,7 +324,6 @@ export default function (options: ApplicationOptions): Rule { routing: options.routing, routingScope: 'Root', path: sourceDir, - spec: false, project: options.name, }), schematic('component', { diff --git a/packages/schematics/angular/library/index.ts b/packages/schematics/angular/library/index.ts index c656b0a100a3..a01a02492273 100644 --- a/packages/schematics/angular/library/index.ts +++ b/packages/schematics/angular/library/index.ts @@ -226,7 +226,6 @@ export default function (options: LibraryOptions): Rule { commonModule: false, flat: true, path: sourceDir, - spec: false, project: options.name, }), schematic('component', { diff --git a/packages/schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__.module.spec.ts b/packages/schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__.module.spec.ts deleted file mode 100644 index f4854eb34e12..000000000000 --- a/packages/schematics/angular/module/files/__name@dasherize@if-flat__/__name@dasherize__.module.spec.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { <%= classify(name) %>Module } from './<%= dasherize(name) %>.module'; - -describe('<%= classify(name) %>Module', () => { - let <%= camelize(name) %>Module: <%= classify(name) %>Module; - - beforeEach(() => { - <%= camelize(name) %>Module = new <%= classify(name) %>Module(); - }); - - it('should create an instance', () => { - expect(<%= camelize(name) %>Module).toBeTruthy(); - }); -}); diff --git a/packages/schematics/angular/module/index.ts b/packages/schematics/angular/module/index.ts index 299ec6f8cdfb..eccb6c415668 100644 --- a/packages/schematics/angular/module/index.ts +++ b/packages/schematics/angular/module/index.ts @@ -88,7 +88,6 @@ export default function (options: ModuleOptions): Rule { options.path = parsedPath.path; const templateSource = apply(url('./files'), [ - options.spec ? noop() : filter(path => !path.endsWith('.spec.ts')), options.routing ? noop() : filter(path => !path.endsWith('-routing.module.ts')), template({ ...strings, diff --git a/packages/schematics/angular/module/index_spec.ts b/packages/schematics/angular/module/index_spec.ts index a3d988d0c809..c267e591e669 100644 --- a/packages/schematics/angular/module/index_spec.ts +++ b/packages/schematics/angular/module/index_spec.ts @@ -18,7 +18,6 @@ describe('Module Schematic', () => { ); const defaultOptions: ModuleOptions = { name: 'foo', - spec: true, module: undefined, flat: false, project: 'bar', @@ -50,7 +49,6 @@ describe('Module Schematic', () => { const tree = schematicRunner.runSchematic('module', options, appTree); const files = tree.files; - expect(files.indexOf('/projects/bar/src/app/foo/foo.module.spec.ts')).toBeGreaterThanOrEqual(0); expect(files.indexOf('/projects/bar/src/app/foo/foo.module.ts')).toBeGreaterThanOrEqual(0); }); @@ -104,15 +102,6 @@ describe('Module Schematic', () => { expect(routingModuleContent).toMatch(/RouterModule.forChild\(routes\)/); }); - it('should respect the spec flag', () => { - const options = { ...defaultOptions, spec: false }; - - const tree = schematicRunner.runSchematic('module', options, appTree); - const files = tree.files; - expect(files.indexOf('/projects/bar/src/app/foo/foo.module.ts')).toBeGreaterThanOrEqual(0); - expect(files.indexOf('/projects/bar/src/app/foo/foo.module.spec.ts')).toEqual(-1); - }); - it('should dasherize a name', () => { const options = { ...defaultOptions, name: 'TwoWord' }; @@ -120,8 +109,6 @@ describe('Module Schematic', () => { const files = tree.files; expect(files.indexOf('/projects/bar/src/app/two-word/two-word.module.ts')) .toBeGreaterThanOrEqual(0); - expect(files.indexOf('/projects/bar/src/app/two-word/two-word.module.spec.ts')) - .toBeGreaterThanOrEqual(0); }); it('should respect the sourceRoot value', () => { diff --git a/packages/schematics/angular/module/schema.json b/packages/schematics/angular/module/schema.json index 8dac5b5aa502..c52ffab315a0 100644 --- a/packages/schematics/angular/module/schema.json +++ b/packages/schematics/angular/module/schema.json @@ -36,11 +36,6 @@ "description": "The scope for the generated routing.", "default": "Child" }, - "spec": { - "type": "boolean", - "description": "Specifies if a spec file is generated.", - "default": true - }, "flat": { "type": "boolean", "description": "Flag to indicate if a dir is created.",