(body: unknown)
| 112 | |
| 113 | describe('execute: GraphQL responses', () => { |
| 114 | async function runGraphql(body: unknown): Promise<string> { |
| 115 | mockIdentityProbe({ accounts: [{ id: ACCOUNT_ID, name: 'Acc' }] }) |
| 116 | server.use(http.post(`${API_BASE}/graphql`, () => HttpResponse.json(body as object))) |
| 117 | const result = await callTool(API_TOKEN, 'execute', { |
| 118 | code: `async () => cloudflare.request({ method: "POST", path: "/graphql", body: { query: "{ viewer { __typename } }" } })` |
| 119 | }) |
| 120 | return toolText(result) |
| 121 | } |
| 122 | |
| 123 | it('normalizes a successful GraphQL response (result = data.data)', async () => { |
| 124 | const text = await runGraphql({ data: { viewer: { __typename: 'Viewer' } } }) |
no test coverage detected