()
| 228 | |
| 229 | it('should handle stream errors and send error chunk', async () => { |
| 230 | async function* errorStream(): AsyncGenerator<StreamChunk> { |
| 231 | yield { |
| 232 | type: EventType.TEXT_MESSAGE_CONTENT, |
| 233 | messageId: 'msg-1', |
| 234 | model: 'test', |
| 235 | timestamp: Date.now(), |
| 236 | delta: 'Test', |
| 237 | content: 'Test', |
| 238 | } |
| 239 | throw new Error('Stream error') |
| 240 | } |
| 241 | |
| 242 | const sseStream = toServerSentEventsStream(errorStream()) |
| 243 | const output = await readStream(sseStream) |
no test coverage detected