Skip to content

Commit

Permalink
[Auth] Reproduce CI test compilation error. (#7966)
Browse files Browse the repository at this point in the history
Update Auth's timeout stub to handle undefined duration. This fixes an build error in Auth CI.
  • Loading branch information
DellaBitta committed Jan 23, 2024
1 parent 434f841 commit 9ea0e3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/auth/test/helpers/timeout_stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export function stubTimeouts(ids?: number[]): TimerMap {
let idCounter = 0;

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

0 comments on commit 9ea0e3b

Please sign in to comment.