File tree 2 files changed +10
-2
lines changed
packages/angular_devkit/build_angular/src/builders/dev-server/specs
tests/legacy-cli/e2e/utils
2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ describe('Dev Server Builder', () => {
34
34
expect ( output . success ) . toBe ( true ) ;
35
35
36
36
// When webpack-dev-server doesn't have `contentBase: false`, this will serve the repo README.
37
- const response = await fetch ( ' http://localhost:4200 /README.md' , {
37
+ const response = await fetch ( ` http://localhost:${ output . port } /README.md` , {
38
38
headers : {
39
39
'Accept' : 'text/html' ,
40
40
} ,
Original file line number Diff line number Diff line change @@ -165,9 +165,17 @@ export function useCIDefaults(projectName = 'test-project') {
165
165
const appTargets = project . targets || project . architect ;
166
166
appTargets . build . options . progress = false ;
167
167
appTargets . test . options . progress = false ;
168
- // Disable auto-updating webdriver in e2e.
169
168
if ( appTargets . e2e ) {
169
+ // Disable auto-updating webdriver in e2e.
170
170
appTargets . e2e . options . webdriverUpdate = false ;
171
+ // Use a random port in e2e.
172
+ appTargets . e2e . options . port = 0 ;
173
+ }
174
+
175
+ if ( appTargets . serve ) {
176
+ // Use a random port in serve.
177
+ appTargets . serve . options ??= { } ;
178
+ appTargets . serve . options . port = 0 ;
171
179
}
172
180
} ) ;
173
181
}
You can’t perform that action at this time.
0 commit comments