mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 08:37:41 +00:00
refactor(web-test): share mock listener harness
This commit is contained in:
@@ -162,6 +162,18 @@ export function createWebListenerFactoryCapture(): AnyExport {
|
||||
};
|
||||
}
|
||||
|
||||
export function createMockWebListener() {
|
||||
return {
|
||||
close: vi.fn(async () => undefined),
|
||||
onClose: new Promise<import("./inbound.js").WebListenerCloseReason>(() => {}),
|
||||
signalClose: vi.fn(),
|
||||
sendMessage: vi.fn(async () => ({ messageId: "msg-1" })),
|
||||
sendPoll: vi.fn(async () => ({ messageId: "poll-1" })),
|
||||
sendReaction: vi.fn(async () => undefined),
|
||||
sendComposingTo: vi.fn(async () => undefined),
|
||||
};
|
||||
}
|
||||
|
||||
export function createWebInboundDeliverySpies(): AnyExport {
|
||||
return {
|
||||
sendMedia: vi.fn(),
|
||||
|
||||
Reference in New Issue
Block a user