mirror of
https://github.com/moltbot/moltbot.git
synced 2026-03-09 15:35:17 +00:00
19 lines
550 B
TypeScript
19 lines
550 B
TypeScript
import { vi } from "vitest";
|
|
|
|
export function buildDispatchInboundCaptureMock<T extends Record<string, unknown>>(
|
|
actual: T,
|
|
setCtx: (ctx: unknown) => void,
|
|
) {
|
|
const dispatchInboundMessage = vi.fn(async (params: { ctx: unknown }) => {
|
|
setCtx(params.ctx);
|
|
return { queuedFinal: false, counts: { tool: 0, block: 0, final: 0 } };
|
|
});
|
|
|
|
return {
|
|
...actual,
|
|
dispatchInboundMessage,
|
|
dispatchInboundMessageWithDispatcher: dispatchInboundMessage,
|
|
dispatchInboundMessageWithBufferedDispatcher: dispatchInboundMessage,
|
|
};
|
|
}
|