(label: string)
| 378 | |
| 379 | /** Invoke the tool and require it to have worked end to end. */ |
| 380 | const call = (label: string): Effect.Effect<ToolEnvelope, unknown> => |
| 381 | Effect.gen(function* () { |
| 382 | const result = yield* attempt(); |
| 383 | expect( |
| 384 | result.ok, |
| 385 | `the ${label} call reached the upstream and came back (got: ${result.text.slice(0, 400)})`, |
| 386 | ).toBe(true); |
| 387 | const envelope = JSON.parse(result.text) as ToolEnvelope; |
| 388 | expect(envelope.ok, `the ${label} call succeeded`).toBe(true); |
| 389 | return envelope; |
| 390 | }); |
| 391 | |
| 392 | return { attempt, call, oauth, slug, upstream, workos } as const; |
| 393 | }); |
no test coverage detected