( mcpUrl: string, bearer: string, sessionId: string, lastEventId?: string, )
| 199 | } |
| 200 | |
| 201 | const openGet = async ( |
| 202 | mcpUrl: string, |
| 203 | bearer: string, |
| 204 | sessionId: string, |
| 205 | lastEventId?: string, |
| 206 | ): Promise<SseCapture> => { |
| 207 | const abortController = new AbortController(); |
| 208 | const response = await fetch(mcpUrl, { |
| 209 | method: "GET", |
| 210 | headers: { |
| 211 | accept: "text/event-stream", |
| 212 | authorization: `Bearer ${bearer}`, |
| 213 | "mcp-protocol-version": PROTOCOL_VERSION, |
| 214 | "mcp-session-id": sessionId, |
| 215 | ...(lastEventId ? { "last-event-id": lastEventId } : {}), |
| 216 | }, |
| 217 | signal: abortController.signal, |
| 218 | }); |
| 219 | expect(response.status, "GET SSE opens").toBe(200); |
| 220 | return new SseCapture(response, abortController); |
| 221 | }; |
| 222 | |
| 223 | const startPostCapture = async ( |
| 224 | mcpUrl: string, |
no test coverage detected