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 {
255255 // Ex: Remix scope bleed tests.
256256 nock . cleanAll ( ) ;
257257
258- this . _closeServer ( ) ;
258+ void this . _closeServer ( ) . then ( ( ) => {
259+ resolve ( envelopes ) ;
260+ } ) ;
261+ } else {
262+ resolve ( envelopes ) ;
259263 }
260-
261- resolve ( envelopes ) ;
262264 }
263265
264266 return true ;
@@ -300,19 +302,24 @@ export class TestEnv {
300302
301303 nock . cleanAll ( ) ;
302304
303- this . _closeServer ( ) ;
304- resolve ( reqCount ) ;
305+ void this . _closeServer ( ) . then ( ( ) => {
306+ resolve ( reqCount ) ;
307+ } ) ;
305308 } , options . timeout || 1000 ) ;
306309 } ) ;
307310 }
308311
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+ } ) ;
316323 } ) ;
317324 }
318325}
You can’t perform that action at this time.
0 commit comments