mirror of https://github.com/openclaw/openclaw.git
WhatsApp: align deliver-reply test mocks with imports
This commit is contained in:
parent
8b0cbebe43
commit
aaf47ca54b
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue