(
overrides?: Partial<{
generateSpeech: (...args: Array<any>) => Promise<any>
}>,
)
| 422 | |
| 423 | describe('generateSpeech({ stream: true })', () => { |
| 424 | function createMockTTSAdapter( |
| 425 | overrides?: Partial<{ |
| 426 | generateSpeech: (...args: Array<any>) => Promise<any> |
| 427 | }>, |
| 428 | ) { |
| 429 | return { |
| 430 | kind: 'tts' as const, |
| 431 | name: 'test-tts', |
| 432 | model: 'test-model', |
| 433 | '~types': {} as any, |
| 434 | generateSpeech: |
| 435 | overrides?.generateSpeech ?? |
| 436 | vi.fn(async () => ({ |
| 437 | id: 'speech-1', |
| 438 | model: 'test-model', |
| 439 | audio: 'base64-audio-data', |
| 440 | format: 'mp3', |
| 441 | duration: 2.5, |
| 442 | contentType: 'audio/mp3', |
| 443 | })), |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | it('should emit RUN_STARTED, CUSTOM result, and RUN_FINISHED', async () => { |
| 448 | const adapter = createMockTTSAdapter() |
no outgoing calls
no test coverage detected