Skip to content

Commit

Permalink
test(node-http-handler): use legacy fakeTimers
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr committed Oct 5, 2021
1 parent c1c7511 commit d5aaafd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit d5aaafd

Please sign in to comment.