Skip to content

Commit b77b970

Browse files
committed
test(node-http-handler): use legacy fakeTimers
1 parent 950284e commit b77b970

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/node-http-handler/src/set-connection-timeout.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ describe("setConnectionTimeout", () => {
2929
};
3030

3131
beforeEach(() => {
32-
jest.useFakeTimers();
32+
jest.useFakeTimers("legacy");
3333
setConnectionTimeout(clientRequest, reject, timeoutInMs);
3434
});
3535

36+
afterEach(() => {
37+
jest.useRealTimers();
38+
});
39+
3640
it("attaches listener", () => {
3741
expect(clientRequest.on).toHaveBeenCalledTimes(1);
3842
expect(clientRequest.on).toHaveBeenCalledWith("socket", expect.any(Function));

0 commit comments

Comments
 (0)