Skip to content

Commit 4aa17b2

Browse files
sumitarorahansl
authored andcommitted
fix(@angular/cli): fix skip e2e
1 parent 091fa6e commit 4aa17b2

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

packages/@angular/cli/blueprints/ng/files/angular-cli.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@
2828
"prod": "environments/environment.prod.ts"
2929
}
3030
}
31-
],
31+
],<% if(e2e) { %>
3232
"e2e": {
3333
"protractor": {
3434
"config": "./protractor.conf.js"
3535
}
36-
},
36+
},<% } %>
3737
"lint": [
3838
{
3939
"project": "<%= sourceDir %>/tsconfig.app.json"
4040
},
4141
{
4242
"project": "<%= sourceDir %>/tsconfig.spec.json"
43-
},
43+
}<% if(e2e) { %>,
4444
{
4545
"project": "e2e/tsconfig.e2e.json"
46-
}
46+
}<% } %>
4747
],
4848
"test": {
4949
"karma": {

packages/@angular/cli/blueprints/ng/files/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"start": "ng serve",
88
"build": "ng build",
99
"test": "ng test",
10-
"lint": "ng lint",
11-
"e2e": "ng e2e"
10+
"lint": "ng lint"<% if(e2e) { %>,
11+
"e2e": "ng e2e"<% } %>
1212
},
1313
"private": true,
1414
"dependencies": {

packages/@angular/cli/blueprints/ng/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export default Blueprint.extend({
8484
fileList = fileList
8585
.filter(p => p.indexOf('protractor.conf.js') < 0)
8686
.filter(p => p.indexOf('app.po.ts') < 0)
87+
.filter(p => p.indexOf('tsconfig.e2e.json') < 0)
8788
.filter(p => p.indexOf('app.e2e-spec.ts') < 0);
8889
}
8990

packages/@angular/cli/commands/e2e.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ const E2eCommand = Command.extend({
8989
if (!commandOptions.config) {
9090
const e2eConfig = CliConfig.fromProject().config.e2e;
9191

92-
if (!e2eConfig.protractor.config) {
92+
if (!e2eConfig) {
93+
throw new SilentError('No e2e config found in .angular-cli.json.');
94+
} else if (!e2eConfig.protractor.config) {
9395
throw new SilentError('No protractor config found in .angular-cli.json.');
9496
}
9597

0 commit comments

Comments
 (0)