(chunks: Array<T>)
| 26 | createOpenRouterText('openai/gpt-4o-mini', 'test-key') |
| 27 | |
| 28 | function createAsyncIterable<T>(chunks: Array<T>): AsyncIterable<T> { |
| 29 | return { |
| 30 | [Symbol.asyncIterator]() { |
| 31 | let index = 0 |
| 32 | return { |
| 33 | // eslint-disable-next-line @typescript-eslint/require-await |
| 34 | async next() { |
| 35 | if (index < chunks.length) { |
| 36 | return { value: chunks[index++]!, done: false } |
| 37 | } |
| 38 | return { value: undefined as T, done: true } |
| 39 | }, |
| 40 | } |
| 41 | }, |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | describe('OpenRouter usage extraction', () => { |
| 46 | beforeEach(() => { |
no outgoing calls
no test coverage detected