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