File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/node-integration-tests/utils Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import type { AxiosRequestConfig } from 'axios';
66import axios from 'axios' ;
77import type { Express } from 'express' ;
88import type * as http from 'http' ;
9+ import type { HttpTerminator } from 'http-terminator' ;
910import { createHttpTerminator } from 'http-terminator' ;
1011import type { AddressInfo } from 'net' ;
1112import nock from 'nock' ;
@@ -125,10 +126,12 @@ async function makeRequest(
125126
126127export class TestEnv {
127128 private _axiosConfig : AxiosRequestConfig | undefined = undefined ;
129+ private _terminator : HttpTerminator ;
128130
129131 public constructor ( public readonly server : http . Server , public readonly url : string ) {
130132 this . server = server ;
131133 this . url = url ;
134+ this . _terminator = createHttpTerminator ( { server : this . server , gracefulTerminationTimeout : 0 } ) ;
132135
133136 // We need to destroy the socket after the response has been sent
134137 // to prevent the server.close (called inside nock interceptor) from hanging in tests.
@@ -319,6 +322,6 @@ export class TestEnv {
319322 }
320323
321324 private _closeServer ( ) : Promise < void > {
322- return createHttpTerminator ( { server : this . server } ) . terminate ( ) ;
325+ return this . _terminator . terminate ( ) ;
323326 }
324327}
You can’t perform that action at this time.
0 commit comments