MCPcopy
hub / github.com/google-gemini/gemini-cli / fromAsync

Function fromAsync

packages/core/src/core/client.test.ts:157–163  ·  view source on GitHub ↗

* Array.fromAsync ponyfill, which will be available in es 2024. * * Buffers an async generator into an array and returns the result.

(promise: AsyncGenerator<T>)

Source from the content-addressed store, hash-verified

155 * Buffers an async generator into an array and returns the result.
156 */
157async function fromAsync<T>(promise: AsyncGenerator<T>): Promise<readonly T[]> {
158 const results: T[] = [];
159 for await (const result of promise) {
160 results.push(result);
161 }
162 return results;
163}
164
165describe('Gemini Client (client.ts)', () => {
166 let mockContentGenerator: ContentGenerator;

Callers 1

client.test.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected