| 4 | import { RequestDeadlineError } from '@kilocode/event-service'; |
| 5 | import type { KiloChatClientConfig } from '../src/types'; |
| 6 | |
| 7 | function createMockConfig(fetchFn: typeof globalThis.fetch): KiloChatClientConfig { |
| 8 | return { |
| 9 | eventService: { on: vi.fn(() => () => {}) } as unknown as KiloChatClientConfig['eventService'], |
| 10 | baseUrl: 'https://chat.example.com', |
| 11 | getToken: vi.fn().mockResolvedValue('test-token'), |
| 12 | fetch: fetchFn, |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | function mockFetch(status: number, body: unknown): typeof globalThis.fetch { |