MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / generateValues

Function generateValues

common/src/util/__tests__/error-abort.test.ts:459–467  ·  view source on GitHub ↗
(signal: { aborted: boolean })

Source from the content-addressed store, hash-verified

457
458 describe('abort during async iteration', () => {
459 async function* generateValues(signal: { aborted: boolean }): AsyncGenerator<PromptResult<number>> {
460 for (let i = 0; i < 5; i++) {
461 if (signal.aborted) {
462 yield promptAborted(`Aborted at iteration ${i}`)
463 return
464 }
465 yield promptSuccess(i)
466 }
467 }
468
469 async function collectValues(signal: { aborted: boolean }): Promise<{ values: number[]; abortedAt?: string }> {
470 const values: number[] = []

Callers 2

collectValuesFunction · 0.85

Calls 2

promptAbortedFunction · 0.90
promptSuccessFunction · 0.90

Tested by

no test coverage detected