( target: TargetShape, identity: Identity, method: string, path: string, body?: unknown, )
| 49 | }); |
| 50 | |
| 51 | const request = ( |
| 52 | target: TargetShape, |
| 53 | identity: Identity, |
| 54 | method: string, |
| 55 | path: string, |
| 56 | body?: unknown, |
| 57 | ): Effect.Effect<Response> => |
| 58 | Effect.promise(() => |
| 59 | fetch(new URL(path, target.baseUrl), { |
| 60 | method, |
| 61 | headers: { |
| 62 | ...(identity.headers ?? {}), |
| 63 | origin: new URL(target.baseUrl).origin, |
| 64 | ...(body === undefined ? {} : { "content-type": "application/json" }), |
| 65 | }, |
| 66 | ...(body === undefined ? {} : { body: JSON.stringify(body) }), |
| 67 | }), |
| 68 | ); |
| 69 | |
| 70 | const expectForbidden = ( |
| 71 | target: TargetShape, |
no test coverage detected