mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-15 03:01:02 +00:00
test: speed up whatsapp send api test
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { createWebSendApi } from "./send-api.js";
|
||||
|
||||
const recordChannelActivity = vi.hoisted(() => vi.fn());
|
||||
let createWebSendApi: typeof import("./send-api.js").createWebSendApi;
|
||||
|
||||
vi.mock("openclaw/plugin-sdk/infra-runtime", async () => {
|
||||
const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/infra-runtime")>(
|
||||
@@ -18,10 +18,8 @@ describe("createWebSendApi", () => {
|
||||
const sendPresenceUpdate = vi.fn(async () => {});
|
||||
let api: ReturnType<typeof createWebSendApi>;
|
||||
|
||||
beforeEach(async () => {
|
||||
vi.resetModules();
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
({ createWebSendApi } = await import("./send-api.js"));
|
||||
api = createWebSendApi({
|
||||
sock: { sendMessage, sendPresenceUpdate },
|
||||
defaultAccountId: "main",
|
||||
|
||||
Reference in New Issue
Block a user