mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 07:47:39 +00:00
test(synology-chat): use real plugin-sdk helper exports
This commit is contained in:
committed by
Peter Steinberger
parent
aeeb0474c6
commit
2b088ca125
@@ -11,17 +11,21 @@ type RegisteredRoute = {
|
|||||||
const registerPluginHttpRouteMock = vi.fn<(params: RegisteredRoute) => () => void>(() => vi.fn());
|
const registerPluginHttpRouteMock = vi.fn<(params: RegisteredRoute) => () => void>(() => vi.fn());
|
||||||
const dispatchReplyWithBufferedBlockDispatcher = vi.fn().mockResolvedValue({ counts: {} });
|
const dispatchReplyWithBufferedBlockDispatcher = vi.fn().mockResolvedValue({ counts: {} });
|
||||||
|
|
||||||
vi.mock("openclaw/plugin-sdk", () => ({
|
vi.mock("openclaw/plugin-sdk", async (importOriginal) => {
|
||||||
DEFAULT_ACCOUNT_ID: "default",
|
const actual = await importOriginal<typeof import("openclaw/plugin-sdk")>();
|
||||||
setAccountEnabledInConfigSection: vi.fn((_opts: any) => ({})),
|
return {
|
||||||
registerPluginHttpRoute: registerPluginHttpRouteMock,
|
...actual,
|
||||||
buildChannelConfigSchema: vi.fn((schema: any) => ({ schema })),
|
DEFAULT_ACCOUNT_ID: "default",
|
||||||
createFixedWindowRateLimiter: vi.fn(() => ({
|
setAccountEnabledInConfigSection: vi.fn((_opts: any) => ({})),
|
||||||
isRateLimited: vi.fn(() => false),
|
registerPluginHttpRoute: registerPluginHttpRouteMock,
|
||||||
size: vi.fn(() => 0),
|
buildChannelConfigSchema: vi.fn((schema: any) => ({ schema })),
|
||||||
clear: vi.fn(),
|
createFixedWindowRateLimiter: vi.fn(() => ({
|
||||||
})),
|
isRateLimited: vi.fn(() => false),
|
||||||
}));
|
size: vi.fn(() => 0),
|
||||||
|
clear: vi.fn(),
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
vi.mock("./runtime.js", () => ({
|
vi.mock("./runtime.js", () => ({
|
||||||
getSynologyRuntime: vi.fn(() => ({
|
getSynologyRuntime: vi.fn(() => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user