mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:31:25 +00:00
test(discord): fix updated test harness mocks
This commit is contained in:
@@ -29,16 +29,20 @@ const mockRestPost = vi.hoisted(() => vi.fn());
|
||||
const mockRestPatch = vi.hoisted(() => vi.fn());
|
||||
const mockRestDelete = vi.hoisted(() => vi.fn());
|
||||
|
||||
vi.mock("../send.shared.js", () => ({
|
||||
createDiscordClient: () => ({
|
||||
rest: {
|
||||
post: mockRestPost,
|
||||
patch: mockRestPatch,
|
||||
delete: mockRestDelete,
|
||||
},
|
||||
request: (_fn: () => Promise<unknown>, _label: string) => _fn(),
|
||||
}),
|
||||
}));
|
||||
vi.mock("../send.shared.js", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../send.shared.js")>();
|
||||
return {
|
||||
...actual,
|
||||
createDiscordClient: () => ({
|
||||
rest: {
|
||||
post: mockRestPost,
|
||||
patch: mockRestPatch,
|
||||
delete: mockRestDelete,
|
||||
},
|
||||
request: (_fn: () => Promise<unknown>, _label: string) => _fn(),
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("../../gateway/client.js", () => ({
|
||||
GatewayClient: class {
|
||||
|
||||
Reference in New Issue
Block a user