mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 04:02:42 +00:00
test: add fetch mock helper and reaction coverage
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user