Skip to content
This repository has been archived by the owner on Sep 30, 2018. It is now read-only.

Commit

Permalink
fix(model): remove redundant code, adjust code style
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastrajan committed Sep 24, 2018
1 parent bc160eb commit 9bb6144
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 36 deletions.
5 changes: 0 additions & 5 deletions src/model/index.ts
Expand Up @@ -60,11 +60,6 @@ export function modelService(options: ModelServiceOptions): Rule {
])
),
options.lintFix ? applyLintFix(options.path) : noop()
]);

return chain([
mergeWith(templateSource, MergeStrategy.Default),
options.lintFix ? applyLintFix(options.path) : noop()
])(host, _context);
};
}
Expand Down
10 changes: 3 additions & 7 deletions src/model/index_spec.ts
Expand Up @@ -76,12 +76,8 @@ describe('Model Schematic', () => {
const options = { ...defaultOptions, name: 'foo', path: 'path' };

const tree = runner.runSchematic('model', options, appTree);
expect(tree.files).toContain(
'/path/foo/foo.service.ts'
);
expect(tree.files).toContain(
'/path/foo/foo.service.spec.ts'
);
expect(tree.files).toContain('/path/foo/foo.service.ts');
expect(tree.files).toContain('/path/foo/foo.service.spec.ts');
});

it('should respect the flat flag', () => {
Expand Down Expand Up @@ -154,7 +150,7 @@ describe('Model Schematic', () => {
const options = { ...defaultOptions };

const tree = runner.runSchematic('model', options, appTree);
const content = tree.readContent('/projects/bar/src/app/app.module.ts');
const content = tree.readContent('/projects/bar/src/app/app.module.ts');
expect(content).not.toMatch(
/import { FooService } from '.\/foo\/foo.service'/
);
Expand Down
24 changes: 0 additions & 24 deletions src/model/schema.d.ts
@@ -1,34 +1,10 @@
export interface Schema {
/**
* The name of the service.
*/
name: string;
/**
* The path to create the service.
*/
path?: string;
/**
* The name of the project.
*/
project?: string;
/**
* Allows specification of the declaring module.
*/
module?: string;
/**
* Flag to indicate if a dir is created.
*/
flat?: boolean;
/**
* Specifies if a spec file is generated.
*/
spec?: boolean;
/**
* Specifies whether to apply lint fixes after generating the component.
*/
lintFix?: boolean;
/**
* Flag to indicate if model is a collection of items.
*/
items?: boolean;
}

0 comments on commit 9bb6144

Please sign in to comment.