@@ -196,14 +196,15 @@ for (const source of imageSource) {
196
196
it ( `will be able to interact with the container` , async ( ) => {
197
197
const worker = helper . runLongLived ( "wrangler dev" ) ;
198
198
const ready = await worker . waitForReady ( ) ;
199
- await worker . readUntil ( / C o n t a i n e r i m a g e \( s \) r e a d y / ) ;
200
199
201
- let response = await fetch ( `${ ready . url } /status` ) ;
202
- expect ( response . status ) . toBe ( 200 ) ;
203
- let status = await response . json ( ) ;
204
- expect ( status ) . toBe ( false ) ;
200
+ await vi . waitFor ( async ( ) => {
201
+ const response = await fetch ( `${ ready . url } /status` ) ;
202
+ expect ( response . status ) . toBe ( 200 ) ;
203
+ const status = await response . json ( ) ;
204
+ expect ( status ) . toBe ( false ) ;
205
+ } ) ;
205
206
206
- response = await fetch ( `${ ready . url } /start` ) ;
207
+ let response = await fetch ( `${ ready . url } /start` ) ;
207
208
let text = await response . text ( ) ;
208
209
expect ( response . status ) . toBe ( 200 ) ;
209
210
expect ( text ) . toBe ( "Container create request sent..." ) ;
@@ -212,7 +213,7 @@ for (const source of imageSource) {
212
213
await new Promise ( ( resolve ) => setTimeout ( resolve , 2_000 ) ) ;
213
214
214
215
response = await fetch ( `${ ready . url } /status` ) ;
215
- status = await response . json ( ) ;
216
+ const status = await response . json ( ) ;
216
217
expect ( response . status ) . toBe ( 200 ) ;
217
218
expect ( status ) . toBe ( true ) ;
218
219
0 commit comments