Skip to content

Commit 62a8490

Browse files
nlm-proalexeagle
authored andcommitted
test(@schematics/angular): app and ng-new --minimal shouldn't generate e2e
1 parent 495cf9b commit 62a8490

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

packages/schematics/angular/application/index_spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ describe('Application Schematic', () => {
136136
expect(content.rules['component-selector'][2]).toMatch('app');
137137
});
138138

139+
it('minimal=true should not create e2e project', () => {
140+
const options = { ...defaultOptions, minimal: true };
141+
142+
const tree = schematicRunner.runSchematic('application', options, workspaceTree);
143+
const files = tree.files;
144+
expect(files.indexOf('/projects/foo-e2e')).toEqual(-1);
145+
const confContent = JSON.parse(tree.readContent('/angular.json'));
146+
expect(confContent.projects['foo-e2e']).toBeUndefined();
147+
});
148+
139149
describe(`update package.json`, () => {
140150
it(`should add build-angular to devDependencies`, () => {
141151
const tree = schematicRunner.runSchematic('application', defaultOptions, workspaceTree);

packages/schematics/angular/ng-new/index_spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,14 @@ describe('Ng New Schematic', () => {
6565
expect(files.indexOf('/bar/angular.json')).toBeGreaterThanOrEqual(0);
6666
expect(files.indexOf('/bar/src')).toBe(-1);
6767
});
68+
69+
it('minimal=true should not create e2e project', () => {
70+
const options = { ...defaultOptions, minimal: true };
71+
72+
const tree = schematicRunner.runSchematic('ng-new', options);
73+
const files = tree.files;
74+
expect(files.indexOf('/bar/e2e')).toEqual(-1);
75+
const confContent = JSON.parse(tree.readContent('/bar/angular.json'));
76+
expect(confContent.projects['foo-e2e']).toBeUndefined();
77+
});
6878
});

0 commit comments

Comments
 (0)