(signal: AbortSignal)
| 573 | describe('AbortController integration', () => { |
| 574 | describe('signal.aborted check pattern', () => { |
| 575 | async function mockLlmCallWithSignal(signal: AbortSignal): Promise<PromptResult<string>> { |
| 576 | if (signal.aborted) { |
| 577 | return promptAborted('Signal was already aborted') |
| 578 | } |
| 579 | // Simulate async work |
| 580 | await new Promise((resolve) => setTimeout(resolve, 0)) |
| 581 | if (signal.aborted) { |
| 582 | return promptAborted('Signal aborted during operation') |
| 583 | } |
| 584 | return promptSuccess('Operation completed') |
| 585 | } |
| 586 | |
| 587 | it('returns success when signal is not aborted', async () => { |
| 588 | const controller = new AbortController() |
no test coverage detected