* Setup mock responses for this tool
(
response: unknown,
options: { ok?: boolean; status?: number; headers?: Record<string, string> } = {}
)
| 134 | * Setup mock responses for this tool |
| 135 | */ |
| 136 | setup( |
| 137 | response: unknown, |
| 138 | options: { ok?: boolean; status?: number; headers?: Record<string, string> } = {} |
| 139 | ) { |
| 140 | this.mockResponse = response |
| 141 | this.mockResponseOptions = { |
| 142 | ok: options.ok ?? true, |
| 143 | status: options.status ?? 200, |
| 144 | headers: options.headers ?? { 'content-type': 'application/json' }, |
| 145 | } |
| 146 | this.mockFetch = createToolMockFetch(this.mockResponse, this.mockResponseOptions) |
| 147 | global.fetch = Object.assign(this.mockFetch, { preconnect: vi.fn() }) as typeof fetch |
| 148 | return this |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Setup error responses for this tool |
no test coverage detected