File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed
packages/node-integration-tests/utils Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -255,10 +255,12 @@ export class TestEnv {
255
255
// Ex: Remix scope bleed tests.
256
256
nock . cleanAll ( ) ;
257
257
258
- this . _closeServer ( ) ;
258
+ void this . _closeServer ( ) . then ( ( ) => {
259
+ resolve ( envelopes ) ;
260
+ } ) ;
261
+ } else {
262
+ resolve ( envelopes ) ;
259
263
}
260
-
261
- resolve ( envelopes ) ;
262
264
}
263
265
264
266
return true ;
@@ -300,19 +302,24 @@ export class TestEnv {
300
302
301
303
nock . cleanAll ( ) ;
302
304
303
- this . _closeServer ( ) ;
304
- resolve ( reqCount ) ;
305
+ void this . _closeServer ( ) . then ( ( ) => {
306
+ resolve ( reqCount ) ;
307
+ } ) ;
305
308
} , options . timeout || 1000 ) ;
306
309
} ) ;
307
310
}
308
311
309
- private _closeServer ( ) : void {
310
- this . server . close ( ( ) => {
311
- // @ts -ignore closeAllConnections() is only available from Node v18.2.0
312
- if ( NODE_VERSION >= 18 && this . server . closeAllConnections ) {
313
- // @ts -ignore (Only available in Node 18+)
314
- this . server . closeAllConnections ( ) ;
315
- }
312
+ private _closeServer ( ) : Promise < void > {
313
+ return new Promise < void > ( resolve => {
314
+ this . server . close ( ( ) => {
315
+ // @ts -ignore closeAllConnections() is only available from Node v18.2.0
316
+ if ( NODE_VERSION >= 18 && this . server . closeAllConnections ) {
317
+ // @ts -ignore (Only available in Node 18+)
318
+ this . server . closeAllConnections ( ) ;
319
+ }
320
+
321
+ resolve ( ) ;
322
+ } ) ;
316
323
} ) ;
317
324
}
318
325
}
You can’t perform that action at this time.
0 commit comments