@@ -25,10 +25,10 @@ describe('Dev Server Builder index', () => {
25
25
} ) ;
26
26
27
27
const architect = ( await createArchitect ( host . root ( ) ) ) . architect ;
28
- const run = await architect . scheduleTarget ( targetSpec ) ;
28
+ const run = await architect . scheduleTarget ( targetSpec , { port : 0 } ) ;
29
29
const output = ( await run . result ) as DevServerBuilderOutput ;
30
30
expect ( output . success ) . toBe ( true ) ;
31
- const response = await fetch ( 'http://localhost:4200/index.html' ) ;
31
+ const response = await fetch ( output . baseUrl ) ;
32
32
expect ( await response . text ( ) ) . toContain (
33
33
'<script src="runtime.js" type="module"></script>' +
34
34
'<script src="polyfills.js" type="module"></script>' +
@@ -67,10 +67,10 @@ describe('Dev Server Builder index', () => {
67
67
await workspaces . writeWorkspace ( workspace , workspaces . createWorkspaceHost ( host ) ) ;
68
68
69
69
const architect = ( await createArchitect ( host . root ( ) ) ) . architect ;
70
- const run = await architect . scheduleTarget ( targetSpec ) ;
70
+ const run = await architect . scheduleTarget ( targetSpec , { port : 0 } ) ;
71
71
const output = ( await run . result ) as DevServerBuilderOutput ;
72
72
expect ( output . success ) . toBe ( true ) ;
73
- const response = await fetch ( 'http://localhost:4200/index.html' ) ;
73
+ const response = await fetch ( output . baseUrl ) ;
74
74
expect ( await response . text ( ) ) . toContain (
75
75
'<script src="runtime.js" type="module"></script>' +
76
76
'<script src="polyfills.js" type="module"></script>' +
@@ -89,10 +89,10 @@ describe('Dev Server Builder index', () => {
89
89
} ) ;
90
90
91
91
const architect = ( await createArchitect ( host . root ( ) ) ) . architect ;
92
- const run = await architect . scheduleTarget ( targetSpec ) ;
92
+ const run = await architect . scheduleTarget ( targetSpec , { port : 0 } ) ;
93
93
const output = ( await run . result ) as DevServerBuilderOutput ;
94
94
expect ( output . success ) . toBe ( true ) ;
95
- const response = await fetch ( 'http://localhost:4200/index.html' ) ;
95
+ const response = await fetch ( output . baseUrl ) ;
96
96
expect ( await response . text ( ) ) . toContain (
97
97
'<script src="runtime.js" defer></script>' +
98
98
'<script src="polyfills.js" defer></script>' +
@@ -132,10 +132,10 @@ describe('Dev Server Builder index', () => {
132
132
await workspaces . writeWorkspace ( workspace , workspaces . createWorkspaceHost ( host ) ) ;
133
133
134
134
const architect = ( await createArchitect ( host . root ( ) ) ) . architect ;
135
- const run = await architect . scheduleTarget ( targetSpec ) ;
135
+ const run = await architect . scheduleTarget ( targetSpec , { port : 0 } ) ;
136
136
const output = ( await run . result ) as DevServerBuilderOutput ;
137
137
expect ( output . success ) . toBe ( true ) ;
138
- const response = await fetch ( 'http://localhost:4200/index.html' ) ;
138
+ const response = await fetch ( output . baseUrl ) ;
139
139
expect ( await response . text ( ) ) . toContain ( `lang="${ locale } "` ) ;
140
140
await run . stop ( ) ;
141
141
} ) ;
0 commit comments