

























@@ -4,31 +4,24 @@ import {
44type SlackSystemEventTestOverrides,
55} from "./system-event-test-harness.js";
667-const messageQueueMock = vi.fn();
8-const messageAllowMock = vi.fn();
7+const { messageQueueMock, messageAllowMock } = vi.hoisted(() => ({
8+messageQueueMock: vi.fn(),
9+messageAllowMock: vi.fn(),
10+}));
91110-async function createChannelRuntimeMock() {
11-const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/infra-runtime")>(
12-"openclaw/plugin-sdk/infra-runtime",
13-);
14-return {
15- ...actual,
16-enqueueSystemEvent: (...args: unknown[]) => messageQueueMock(...args),
17-};
18-}
19-20-vi.mock("openclaw/plugin-sdk/infra-runtime", createChannelRuntimeMock);
21-vi.mock("openclaw/plugin-sdk/infra-runtime.js", createChannelRuntimeMock);
12+vi.mock("openclaw/plugin-sdk/infra-runtime", () => ({
13+enqueueSystemEvent: (...args: unknown[]) => messageQueueMock(...args),
14+}));
15+vi.mock("openclaw/plugin-sdk/infra-runtime.js", () => ({
16+enqueueSystemEvent: (...args: unknown[]) => messageQueueMock(...args),
17+}));
18+vi.mock("openclaw/plugin-sdk/security-runtime", () => ({
19+readStoreAllowFromForDmPolicy: async () => [],
20+}));
222123-vi.mock("openclaw/plugin-sdk/conversation-runtime", async () => {
24-const actual = await vi.importActual<typeof import("openclaw/plugin-sdk/conversation-runtime")>(
25-"openclaw/plugin-sdk/conversation-runtime",
26-);
27-return {
28- ...actual,
29-readChannelAllowFromStore: (...args: unknown[]) => messageAllowMock(...args),
30-};
31-});
22+vi.mock("openclaw/plugin-sdk/conversation-runtime", () => ({
23+readChannelAllowFromStore: (...args: unknown[]) => messageAllowMock(...args),
24+}));
32253326let registerSlackMessageEvents: typeof import("./messages.js").registerSlackMessageEvents;
3427此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。