test: share feishu startup mock modules
This commit is contained in:
parent
97dc493e2a
commit
c3e78908c7
@ -8,26 +8,14 @@ vi.mock("./probe.js", () => ({
|
||||
probeFeishu: probeFeishuMock,
|
||||
}));
|
||||
|
||||
vi.mock("./client.js", () => ({
|
||||
createFeishuWSClient: vi.fn(() => ({ start: vi.fn() })),
|
||||
createEventDispatcher: vi.fn(() => ({ register: vi.fn() })),
|
||||
}));
|
||||
vi.mock("./runtime.js", () => ({
|
||||
getFeishuRuntime: () => ({
|
||||
channel: {
|
||||
debounce: {
|
||||
resolveInboundDebounceMs: () => 0,
|
||||
createInboundDebouncer: () => ({
|
||||
enqueue: async () => {},
|
||||
flushKey: async () => {},
|
||||
}),
|
||||
},
|
||||
text: {
|
||||
hasControlCommand: () => false,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}));
|
||||
vi.mock("./client.js", async () => {
|
||||
const { createFeishuClientMockModule } = await import("./monitor.test-mocks.js");
|
||||
return createFeishuClientMockModule();
|
||||
});
|
||||
vi.mock("./runtime.js", async () => {
|
||||
const { createFeishuRuntimeMockModule } = await import("./monitor.test-mocks.js");
|
||||
return createFeishuRuntimeMockModule();
|
||||
});
|
||||
|
||||
function buildMultiAccountWebsocketConfig(accountIds: string[]): ClawdbotConfig {
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user