Skip to content

Commit b2e74d1

Browse files
elvisbegovicKeen Yee Liau
authored andcommitted
feat(@schematics/angular): minimal=true should not create tests files when using ng generate command
Before this commit: `--minimal=true` create project without any testing frameworks and disable e2e, lint, test targets. But, if in this minimal project we try command `ng generate class|component|directive|guard|module|pipe|service`, it will always create `*_spec.ts` files. After this commit: `--minimal=true` override `@schematics/angular` in `angular.json` to not create `*_spec.ts` files when using `ng generate *` commands.
1 parent b68eec2 commit b2e74d1

File tree

1 file changed

+1
-1
lines changed
  • packages/schematics/angular/application

1 file changed

+1
-1
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
168168
schematics['@schematics/angular:component'] = componentSchematicsOptions;
169169
}
170170

171-
if (options.skipTests === true) {
171+
if (options.skipTests || options.minimal) {
172172
['class', 'component', 'directive', 'guard', 'module', 'pipe', 'service'].forEach((type) => {
173173
if (!(`@schematics/angular:${type}` in schematics)) {
174174
schematics[`@schematics/angular:${type}`] = {};

0 commit comments

Comments
 (0)