Skip to content

Commit

Permalink
chore: Make compile with NodeJS v20.5.0 (#1906)
Browse files Browse the repository at this point in the history
An external change to CI appears to run code on NodeJS v20.5.0.

Unfortunately, this breaks our hacky override of Timeout. So as a quick fix, I made it even hackier. Since we only use this for tests, this should be fine.
  • Loading branch information
tom-andersen authored Sep 26, 2023
1 parent 8e621d5 commit 1d72fca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dev/src/backoff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ export function setTimeoutHandler(
[Symbol.toPrimitive]: () => {
throw new Error('For tests only. Not Implemented');
},
};
} as unknown as NodeJS.Timeout;
// `NodeJS.Timeout` type signature change:
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66176/files#diff-e838d0ace9cd5f6516bacfbd3ad00d02cd37bd60f9993ce6223f52d889a1fdbaR122-R126
//
// Adding `[Symbol.dispose](): void;` cannot be done on older versions of
// NodeJS. So we simply cast to `NodeJS.Timeout`.
return timeout;
};
}
Expand Down

0 comments on commit 1d72fca

Please sign in to comment.