mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-02 21:01:51 +00:00
* fix(feishu): close WebSocket connections on monitor stop/abort Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(feishu): add WebSocket cleanup tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(feishu): close WebSocket connections on monitor stop (#52844) (thanks @schumilin) --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: George Zhang <georgezhangtj97@gmail.com>
46 lines
1.1 KiB
TypeScript
46 lines
1.1 KiB
TypeScript
import { vi } from "vitest";
|
|
|
|
export function createFeishuClientMockModule(): {
|
|
createFeishuWSClient: () => { start: () => void; close: () => void };
|
|
createEventDispatcher: () => { register: () => void };
|
|
} {
|
|
return {
|
|
createFeishuWSClient: vi.fn(() => ({ start: vi.fn(), close: 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,
|
|
},
|
|
},
|
|
}),
|
|
};
|
|
}
|