mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-19 13:01:40 +00:00
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
// Simple LLM stream mock helper builds deterministic streamed responses.
|
|
import { vi } from "vitest";
|
|
|
|
type LlmMockModule = Record<string, unknown>;
|
|
|
|
export function createLlmStreamSimpleMock(): LlmMockModule {
|
|
return {
|
|
streamSimple: vi.fn(() => ({
|
|
push: vi.fn(),
|
|
result: vi.fn(async () => undefined),
|
|
[Symbol.asyncIterator]: vi.fn(async function* () {
|
|
// Minimal async stream shape for wrappers that patch iteration/result.
|
|
}),
|
|
})),
|
|
};
|
|
}
|