File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
scripts/emulator-testing/emulators Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,17 @@ export abstract class Emulator {
120120 reject ( `Emulator not ready after ${ timeout } s. Exiting ...` ) ;
121121 } else {
122122 console . log ( `Ping emulator at [http://localhost:${ this . port } ] ...` ) ;
123- request ( `http://localhost:${ this . port } ` , ( error , response ) => {
124- if ( error && error . code === 'ECONNREFUSED' ) {
125- setTimeout ( wait , 1000 , resolve , reject ) ;
126- } else if ( response ) {
123+ fetch ( `http://localhost:${ this . port } ` ) . then (
124+ ( ) => {
127125 // Database and Firestore emulators will return 400 and 200 respectively.
128126 // As long as we get a response back, it means the emulator is ready.
129127 console . log ( `Emulator has started up after ${ elapsed } s!` ) ;
130128 resolve ( ) ;
131- } else {
132- // This should not happen.
133- reject ( { error , response } ) ;
129+ } ,
130+ error => {
131+ setTimeout ( wait , 1000 , resolve , reject ) ;
134132 }
135- } ) ;
133+ ) ;
136134 }
137135 } ;
138136 setTimeout ( wait , 1000 , resolve , reject ) ;
You can’t perform that action at this time.
0 commit comments