Skip to content

Commit e2e6e77

Browse files
author
renkelvin
committed
Update timeout_stub.ts
1 parent 1c84815 commit e2e6e77

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/auth/test/helpers/timeout_stub.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ export function stubTimeouts(ids?: number[]): TimerMap {
3636
let idCounter = 0;
3737

3838
sinon.stub(window, 'setTimeout').callsFake((cb: () => void, duration) => {
39-
callbacks[duration] = cb;
39+
if (duration !== undefined) {
40+
callbacks[duration] = cb;
41+
}
4042
// For some bizarre reason setTimeout always get shoehorned into NodeJS.Timeout,
4143
// which is flat-wrong. This is the easiest way to fix it.
4244
// eslint-disable-next-line @typescript-eslint/no-explicit-any

0 commit comments

Comments
 (0)