WhatsApp: align deliver-reply test mocks with imports

This commit is contained in:
Gustavo Madeira Santana 2026-03-29 23:36:38 -04:00
parent 8b0cbebe43
commit aaf47ca54b
No known key found for this signature in database
1 changed files with 7 additions and 7 deletions

View File

@ -1,5 +1,5 @@
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import { sleep } from "openclaw/plugin-sdk/runtime-env";
import { sleep } from "openclaw/plugin-sdk/text-runtime";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
import { loadWebMedia } from "../media.js";
import type { WebInboundMsg } from "./types.js";
@ -13,18 +13,18 @@ vi.mock("openclaw/plugin-sdk/runtime-env", async (importOriginal) => {
};
});
vi.mock("../media.js", () => ({
loadWebMedia: vi.fn(),
}));
vi.mock("openclaw/plugin-sdk/runtime-env", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/runtime-env")>();
vi.mock("openclaw/plugin-sdk/text-runtime", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/text-runtime")>();
return {
...actual,
sleep: vi.fn(async () => {}),
};
});
vi.mock("../media.js", () => ({
loadWebMedia: vi.fn(),
}));
let deliverWebReply: typeof import("./deliver-reply.js").deliverWebReply;
function makeMsg(): WebInboundMsg {