mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 07:10:22 +00:00
perf(memory): trim telegram monitor test module churn
This commit is contained in:
@@ -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"));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user