Skip to content

Commit a7b2fc6

Browse files
chore(angular): fix failing e2e tests (#1194)
1 parent 4c7b400 commit a7b2fc6

File tree

9 files changed

+100
-96
lines changed

9 files changed

+100
-96
lines changed

angular.json

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
11
{
2-
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
2+
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
4+
"defaultProject": "app",
5+
"newProjectRoot": "projects",
46
"projects": {
57
"app": {
68
"root": "",
9+
"sourceRoot": "src",
710
"projectType": "application",
11+
"prefix": "app",
12+
"schematics": {},
813
"architect": {
914
"build": {
1015
"builder": "@angular-devkit/build-angular:browser",
1116
"options": {
12-
"progress": false,
1317
"outputPath": "www",
1418
"index": "src/index.html",
1519
"main": "src/main.ts",
1620
"polyfills": "src/polyfills.ts",
17-
"tsConfig": "src/tsconfig.app.json",
21+
"tsConfig": "tsconfig.app.json",
1822
"assets": [
1923
{
2024
"glob": "**/*",
@@ -25,8 +29,7 @@
2529
"glob": "**/*.svg",
2630
"input": "node_modules/ionicons/dist/ionicons/svg",
2731
"output": "./svg"
28-
},
29-
"src/manifest.json"
32+
}
3033
],
3134
"styles": [
3235
{
@@ -36,15 +39,14 @@
3639
"input": "src/global.scss"
3740
}
3841
],
39-
"scripts": [],
40-
"es5BrowserSupport": true
42+
"scripts": []
4143
},
4244
"configurations": {
4345
"production": {
4446
"fileReplacements": [
4547
{
46-
"src": "src/environments/environment.ts",
47-
"replaceWith": "src/environments/environment.prod.ts"
48+
"replace": "src/environments/environment.ts",
49+
"with": "src/environments/environment.prod.ts"
4850
}
4951
],
5052
"optimization": true,
@@ -56,7 +58,17 @@
5658
"extractLicenses": true,
5759
"vendorChunk": false,
5860
"buildOptimizer": true,
59-
"serviceWorker": true
61+
"serviceWorker": true,
62+
"budgets": [
63+
{
64+
"type": "initial",
65+
"maximumWarning": "2mb",
66+
"maximumError": "5mb"
67+
}
68+
]
69+
},
70+
"ci": {
71+
"progress": false
6072
}
6173
}
6274
},
@@ -69,6 +81,9 @@
6981
"configurations": {
7082
"production": {
7183
"browserTarget": "app:build:production"
84+
},
85+
"ci": {
86+
"progress": false
7287
}
7388
}
7489
},
@@ -83,7 +98,7 @@
8398
"options": {
8499
"main": "src/test.ts",
85100
"polyfills": "src/polyfills.ts",
86-
"tsConfig": "src/tsconfig.spec.json",
101+
"tsConfig": "tsconfig.spec.json",
87102
"karmaConfig": "src/karma.conf.js",
88103
"styles": [
89104
{
@@ -104,28 +119,40 @@
104119
"glob": "**/*",
105120
"input": "src/assets",
106121
"output": "/assets"
107-
},
108-
"src/manifest.json"
122+
}
109123
]
110124
},
111125
"configurations": {
112126
"ci": {
113-
"watch": false,
114127
"progress": false,
115-
"browsers": "ChromeHeadlessCI"
128+
"watch": false
116129
}
117130
}
118131
},
119132
"lint": {
120133
"builder": "@angular-devkit/build-angular:tslint",
121134
"options": {
122135
"tsConfig": [
123-
"src/tsconfig.app.json",
124-
"src/tsconfig.spec.json"
136+
"tsconfig.app.json",
137+
"tsconfig.spec.json",
138+
"e2e/tsconfig.json"
125139
],
126-
"exclude": [
127-
"**/node_modules/**"
128-
]
140+
"exclude": ["**/node_modules/**"]
141+
}
142+
},
143+
"e2e": {
144+
"builder": "@angular-devkit/build-angular:protractor",
145+
"options": {
146+
"protractorConfig": "e2e/protractor.conf.js",
147+
"devServerTarget": "app:serve"
148+
},
149+
"configurations": {
150+
"production": {
151+
"devServerTarget": "app:serve:production"
152+
},
153+
"ci": {
154+
"devServerTarget": "app:serve:ci"
155+
}
129156
}
130157
},
131158
"ionic-cordova-build": {
@@ -153,38 +180,6 @@
153180
}
154181
}
155182
}
156-
},
157-
"app-e2e": {
158-
"root": "e2e/",
159-
"projectType": "application",
160-
"architect": {
161-
"e2e": {
162-
"builder": "@angular-devkit/build-angular:protractor",
163-
"options": {
164-
"protractorConfig": "e2e/protractor.conf.js",
165-
"devServerTarget": "app:serve",
166-
"webdriverUpdate": false
167-
},
168-
"configurations": {
169-
"production": {
170-
"devServerTarget": "app:serve:production"
171-
},
172-
"ci": {
173-
"devServerTarget": "app:serve:production",
174-
"protractorConfig": "e2e/protractor-ci.conf.js"
175-
}
176-
}
177-
},
178-
"lint": {
179-
"builder": "@angular-devkit/build-angular:tslint",
180-
"options": {
181-
"tsConfig": "e2e/tsconfig.e2e.json",
182-
"exclude": [
183-
"**/node_modules/**"
184-
]
185-
}
186-
}
187-
}
188183
}
189184
},
190185
"cli": {

e2e/protractor.conf.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ exports.config = {
99
'./src/**/*.e2e-spec.ts'
1010
],
1111
capabilities: {
12-
'browserName': 'chrome',
13-
chromeOptions: {
14-
binary: require('puppeteer').executablePath(),
15-
},
12+
'browserName': 'chrome'
1613
},
1714
directConnect: true,
1815
baseUrl: 'http://localhost:4200/',
@@ -24,7 +21,7 @@ exports.config = {
2421
},
2522
onPrepare() {
2623
require('ts-node').register({
27-
project: require('path').join(__dirname, './tsconfig.e2e.json')
24+
project: require('path').join(__dirname, './tsconfig.json')
2825
});
2926
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
3027
}

e2e/tsconfig.e2e.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

e2e/tsconfig.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../out-tsc/app",
5+
"module": "commonjs",
6+
"target": "es5",
7+
"types": [
8+
"jasmine",
9+
"jasminewd2",
10+
"node"
11+
]
12+
}
13+
}

src/tsconfig.app.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/tsconfig.spec.json

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/zone-flags.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/**
2+
* Prevents Angular change detection from
3+
* running with certain Web Component callbacks
4+
*/
5+
(window as any).__Zone_disable_customElements = true;

tsconfig.app.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./out-tsc/app",
5+
"types": []
6+
},
7+
"include": [
8+
"src/**/*.ts"
9+
],
10+
"exclude": [
11+
"src/test.ts",
12+
"src/**/*.spec.ts"
13+
]
14+
}

tsconfig.spec.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./out-tsc/spec",
5+
"types": [
6+
"jasmine",
7+
"node"
8+
]
9+
},
10+
"files": [
11+
"src/test.ts",
12+
"src/zone-flags.ts",
13+
"src/polyfills.ts"
14+
],
15+
"include": [
16+
"src/**/*.spec.ts",
17+
"src/**/*.d.ts"
18+
]
19+
}

0 commit comments

Comments
 (0)