perf(memory): trim telegram monitor test module churn

This commit is contained in:
Vincent Koc
2026-04-02 10:57:01 +09:00
parent 32fa5c3be5
commit dc66c36b9e

View File

@@ -262,10 +262,10 @@ async function monitorWithAutoAbort(opts: Omit<MonitorTelegramOpts, "abortSignal
}
vi.mock("openclaw/plugin-sdk/config-runtime", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/config-runtime")>();
return {
...actual,
loadConfig,
resolveAgentMaxConcurrent: (cfg: { agents?: { defaults?: { maxConcurrent?: number } } }) =>
cfg.agents?.defaults?.maxConcurrent ?? 1,
};
});
@@ -329,27 +329,10 @@ vi.mock("./update-offset-store.js", () => ({
writeTelegramUpdateOffset: vi.fn(async () => undefined),
}));
vi.mock("openclaw/plugin-sdk/reply-runtime", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/reply-runtime")>();
return {
...actual,
getReplyFromConfig: async (ctx: { Body?: string }) => ({
text: `echo:${ctx.Body}`,
}),
};
});
vi.mock("../../../src/auto-reply/reply.js", () => ({
getReplyFromConfig: async (ctx: { Body?: string }) => ({
text: `echo:${ctx.Body}`,
}),
}));
describe("monitorTelegramProvider (grammY)", () => {
let consoleErrorSpy: { mockRestore: () => void } | undefined;
beforeAll(async () => {
vi.resetModules();
({ monitorTelegramProvider } = await import("./monitor.js"));
});