mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-23 07:51:33 +00:00
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { vi } from "vitest";
|
|
|
|
export function createFeishuClientMockModule(): {
|
|
createFeishuWSClient: () => { start: () => void };
|
|
createEventDispatcher: () => { register: () => void };
|
|
} {
|
|
return {
|
|
createFeishuWSClient: vi.fn(() => ({ start: vi.fn() })),
|
|
createEventDispatcher: vi.fn(() => ({ register: vi.fn() })),
|
|
};
|
|
}
|
|
|
|
export function createFeishuRuntimeMockModule(): {
|
|
getFeishuRuntime: () => {
|
|
channel: {
|
|
debounce: {
|
|
resolveInboundDebounceMs: () => number;
|
|
createInboundDebouncer: () => {
|
|
enqueue: () => Promise<void>;
|
|
flushKey: () => Promise<void>;
|
|
};
|
|
};
|
|
text: {
|
|
hasControlCommand: () => boolean;
|
|
};
|
|
};
|
|
};
|
|
} {
|
|
return {
|
|
getFeishuRuntime: () => ({
|
|
channel: {
|
|
debounce: {
|
|
resolveInboundDebounceMs: () => 0,
|
|
createInboundDebouncer: () => ({
|
|
enqueue: async () => {},
|
|
flushKey: async () => {},
|
|
}),
|
|
},
|
|
text: {
|
|
hasControlCommand: () => false,
|
|
},
|
|
},
|
|
}),
|
|
};
|
|
}
|