mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 12:50:23 +00:00
refactor: route more test seams through public plugin APIs
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { afterAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { parseTelegramTarget } from "../../extensions/telegram/src/targets.js";
|
||||
import { parseTelegramTarget } from "../../extensions/telegram/api.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
|
||||
const mockStore: Record<string, Record<string, unknown>> = {};
|
||||
|
||||
@@ -24,7 +24,7 @@ vi.mock("../../pairing/pairing-store.js", () => ({
|
||||
readChannelAllowFromStoreSync: vi.fn(() => []),
|
||||
}));
|
||||
|
||||
vi.mock("../../../extensions/whatsapp/src/accounts.js", () => ({
|
||||
vi.mock("../../plugin-sdk/whatsapp.js", () => ({
|
||||
resolveWhatsAppAccount: vi.fn(() => ({ allowFrom: [] })),
|
||||
}));
|
||||
|
||||
@@ -33,14 +33,14 @@ const mockedModuleIds = [
|
||||
"../../infra/outbound/channel-selection.js",
|
||||
"../../infra/outbound/target-resolver.js",
|
||||
"../../pairing/pairing-store.js",
|
||||
"../../../extensions/whatsapp/src/accounts.js",
|
||||
"../../plugin-sdk/whatsapp.js",
|
||||
];
|
||||
|
||||
import { resolveWhatsAppAccount } from "../../../extensions/whatsapp/src/accounts.js";
|
||||
import { loadSessionStore } from "../../config/sessions.js";
|
||||
import { resolveMessageChannelSelection } from "../../infra/outbound/channel-selection.js";
|
||||
import { maybeResolveIdLikeTarget } from "../../infra/outbound/target-resolver.js";
|
||||
import { readChannelAllowFromStoreSync } from "../../pairing/pairing-store.js";
|
||||
import { resolveWhatsAppAccount } from "../../plugin-sdk/whatsapp.js";
|
||||
import { resolveDeliveryTarget } from "./delivery-target.js";
|
||||
|
||||
afterAll(() => {
|
||||
|
||||
Reference in New Issue
Block a user