* Create a mock adapter whose chatStream throws once iteration begins. * Exercises the error path through the chat pipeline.
( message = 'mock adapter failure', )
| 20 | * Exercises the error path through the chat pipeline. |
| 21 | */ |
| 22 | function createFailingMockAdapter( |
| 23 | message = 'mock adapter failure', |
| 24 | ): ReturnType<typeof createMockAdapter> { |
| 25 | return createMockAdapter({ |
| 26 | chatStreamFn: () => |
| 27 | (async function* (): AsyncIterable<StreamChunk> { |
| 28 | throw new Error(message) |
| 29 | })(), |
| 30 | }) |
| 31 | } |
| 32 | |
| 33 | const logPrefixes = ( |
| 34 | calls: ReadonlyArray<ReadonlyArray<unknown>>, |
no test coverage detected