Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@schematics/angular): remove module test #11278

Merged
merged 1 commit into from
Sep 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/schematics/angular/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ export default function (options: ApplicationOptions): Rule {
routing: options.routing,
routingScope: 'Root',
path: sourceDir,
spec: false,
project: options.name,
}),
schematic('component', {
Expand Down
1 change: 0 additions & 1 deletion packages/schematics/angular/library/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ export default function (options: LibraryOptions): Rule {
commonModule: false,
flat: true,
path: sourceDir,
spec: false,
project: options.name,
}),
schematic('component', {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/schematics/angular/module/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions packages/schematics/angular/module/index_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ describe('Module Schematic', () => {
);
const defaultOptions: ModuleOptions = {
name: 'foo',
spec: true,
module: undefined,
flat: false,
project: 'bar',
Expand Down Expand Up @@ -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);
});

Expand Down Expand Up @@ -104,24 +102,13 @@ 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' };

const tree = schematicRunner.runSchematic('module', options, appTree);
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', () => {
Expand Down
5 changes: 0 additions & 5 deletions packages/schematics/angular/module/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down