diff --git a/packages/node-http-handler/src/set-connection-timeout.spec.ts b/packages/node-http-handler/src/set-connection-timeout.spec.ts index 8d9bf545cfb1..c9667f555ab3 100644 --- a/packages/node-http-handler/src/set-connection-timeout.spec.ts +++ b/packages/node-http-handler/src/set-connection-timeout.spec.ts @@ -29,10 +29,14 @@ describe("setConnectionTimeout", () => { }; beforeEach(() => { - jest.useFakeTimers(); + jest.useFakeTimers("legacy"); setConnectionTimeout(clientRequest, reject, timeoutInMs); }); + afterEach(() => { + jest.useRealTimers(); + }); + it("attaches listener", () => { expect(clientRequest.on).toHaveBeenCalledTimes(1); expect(clientRequest.on).toHaveBeenCalledWith("socket", expect.any(Function));