Skip to content

Commit

Permalink
fix(@angular/cli): fix skip e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
sumitarora authored and hansl committed Apr 25, 2017
1 parent 091fa6e commit 4aa17b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/@angular/cli/blueprints/ng/files/angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
"prod": "environments/environment.prod.ts"
}
}
],
],<% if(e2e) { %>
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
},<% } %>
"lint": [
{
"project": "<%= sourceDir %>/tsconfig.app.json"
},
{
"project": "<%= sourceDir %>/tsconfig.spec.json"
},
}<% if(e2e) { %>,
{
"project": "e2e/tsconfig.e2e.json"
}
}<% } %>
],
"test": {
"karma": {
Expand Down
4 changes: 2 additions & 2 deletions packages/@angular/cli/blueprints/ng/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
"lint": "ng lint"<% if(e2e) { %>,
"e2e": "ng e2e"<% } %>
},
"private": true,
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/@angular/cli/blueprints/ng/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default Blueprint.extend({
fileList = fileList
.filter(p => p.indexOf('protractor.conf.js') < 0)
.filter(p => p.indexOf('app.po.ts') < 0)
.filter(p => p.indexOf('tsconfig.e2e.json') < 0)
.filter(p => p.indexOf('app.e2e-spec.ts') < 0);
}

Expand Down
4 changes: 3 additions & 1 deletion packages/@angular/cli/commands/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ const E2eCommand = Command.extend({
if (!commandOptions.config) {
const e2eConfig = CliConfig.fromProject().config.e2e;

if (!e2eConfig.protractor.config) {
if (!e2eConfig) {
throw new SilentError('No e2e config found in .angular-cli.json.');
} else if (!e2eConfig.protractor.config) {
throw new SilentError('No protractor config found in .angular-cli.json.');
}

Expand Down

0 comments on commit 4aa17b2

Please sign in to comment.