test: add fetch mock helper and reaction coverage

This commit is contained in:
Sebastian
2026-02-17 09:01:30 -05:00
parent 0e023e300e
commit cc359d338e
28 changed files with 193 additions and 106 deletions

View File

@@ -1,4 +1,5 @@
import { type Mock, describe, expect, it, vi, beforeEach, afterEach } from "vitest";
import { withFetchPreconnect } from "../test-utils/fetch-mock.js";
import { probeTelegram } from "./probe.js";
describe("probeTelegram retry logic", () => {
@@ -38,7 +39,7 @@ describe("probeTelegram retry logic", () => {
beforeEach(() => {
vi.useFakeTimers();
fetchMock = vi.fn();
global.fetch = fetchMock;
global.fetch = withFetchPreconnect(fetchMock);
});
afterEach(() => {