Skip to content

Commit f06c3e6

Browse files
committed
Bypass type error in setTimeout mock
1 parent 1461e25 commit f06c3e6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

spec/integ/rendezvous/MSC4108SignInWithQR.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ describe("MSC4108SignInWithQR", () => {
268268
it("should abort if device doesn't come up by timeout", async () => {
269269
jest.spyOn(global, "setTimeout").mockImplementation((fn) => {
270270
(<Function>fn)();
271-
return -1;
271+
// TODO: mock timers properly
272+
return -1 as any;
272273
});
273274
jest.spyOn(Date, "now").mockImplementation(() => {
274275
return 12345678 + mocked(setTimeout).mock.calls.length * 1000;
@@ -320,7 +321,8 @@ describe("MSC4108SignInWithQR", () => {
320321
it("should not send secrets if user cancels", async () => {
321322
jest.spyOn(global, "setTimeout").mockImplementation((fn) => {
322323
(<Function>fn)();
323-
return -1;
324+
// TODO: mock timers properly
325+
return -1 as any;
324326
});
325327

326328
await Promise.all([ourLogin.negotiateProtocols(), opponentLogin.negotiateProtocols()]);

0 commit comments

Comments
 (0)