| 67 | SSE_RESPONSE_HEADERS: {}, |
| 68 | StreamWriter: vi.fn().mockImplementation( |
| 69 | class { |
| 70 | attach = vi.fn().mockImplementation((ctrl: ReadableStreamDefaultController) => { |
| 71 | mockPublisherController = ctrl |
| 72 | }) |
| 73 | startKeepalive = vi.fn() |
| 74 | stopKeepalive = vi.fn() |
| 75 | flush = vi.fn() |
| 76 | close = vi.fn().mockImplementation(() => { |
| 77 | try { |
| 78 | mockPublisherController?.close() |
| 79 | } catch { |
| 80 | // already closed |
| 81 | } |
| 82 | }) |
| 83 | markDisconnected = vi.fn() |
| 84 | publish = vi.fn().mockImplementation(async (event: Record<string, unknown>) => { |
| 85 | appendEvent(event) |
| 86 | }) |
| 87 | get clientDisconnected() { |
| 88 | return false |
| 89 | } |
| 90 | get sawComplete() { |
| 91 | return false |
| 92 | } |
| 93 | } |
| 94 | ), |
| 95 | })) |
| 96 | vi.mock('@/lib/copilot/request/session/sse', () => ({ |
nothing calls this directly
no test coverage detected