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 {
120
120
reject ( `Emulator not ready after ${ timeout } s. Exiting ...` ) ;
121
121
} else {
122
122
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
+ ( ) => {
127
125
// Database and Firestore emulators will return 400 and 200 respectively.
128
126
// As long as we get a response back, it means the emulator is ready.
129
127
console . log ( `Emulator has started up after ${ elapsed } s!` ) ;
130
128
resolve ( ) ;
131
- } else {
132
- // This should not happen.
133
- reject ( { error , response } ) ;
129
+ } ,
130
+ error => {
131
+ setTimeout ( wait , 1000 , resolve , reject ) ;
134
132
}
135
- } ) ;
133
+ ) ;
136
134
}
137
135
} ;
138
136
setTimeout ( wait , 1000 , resolve , reject ) ;
You can’t perform that action at this time.
0 commit comments