( initial: YogaInitialContext, requests: Ref.Ref<readonly GraphqlTestRequest[]>, )
| 98 | }); |
| 99 | |
| 100 | const captureRequest = ( |
| 101 | initial: YogaInitialContext, |
| 102 | requests: Ref.Ref<readonly GraphqlTestRequest[]>, |
| 103 | ) => { |
| 104 | const url = new URL(initial.request.url); |
| 105 | const captured: GraphqlTestRequest = { |
| 106 | url: initial.request.url, |
| 107 | method: initial.request.method, |
| 108 | path: url.pathname, |
| 109 | headers: headersFromRequest(initial.request.headers), |
| 110 | payload: payloadFromParams(initial.params), |
| 111 | }; |
| 112 | return Effect.runPromise( |
| 113 | Ref.update(requests, (all) => [...all, captured]).pipe(Effect.as(captured)), |
| 114 | ); |
| 115 | }; |
| 116 | |
| 117 | export const serveGraphqlTestServer = ( |
| 118 | options: GraphqlTestServerOptions, |
no test coverage detected