fix: unblock ci

This commit is contained in:
Peter Steinberger
2026-01-08 07:39:26 +00:00
parent b341c9af6c
commit 00c1403f5c
3 changed files with 23 additions and 8 deletions

View File

@@ -140,12 +140,17 @@ describe("createTelegramBot", () => {
globalThis.fetch = fetchSpy;
try {
createTelegramBot({ token: "tok" });
expect(botCtorSpy).toHaveBeenCalledWith(
"tok",
expect.objectContaining({
client: expect.objectContaining({ fetch: fetchSpy }),
}),
);
const isBun = "Bun" in globalThis || Boolean(process?.versions?.bun);
if (isBun) {
expect(botCtorSpy).toHaveBeenCalledWith(
"tok",
expect.objectContaining({
client: expect.objectContaining({ fetch: fetchSpy }),
}),
);
} else {
expect(botCtorSpy).toHaveBeenCalledWith("tok", undefined);
}
} finally {
globalThis.fetch = originalFetch;
}