(scenario: ActiveScenario)
| 45 | } |
| 46 | |
| 47 | function runAuth(scenario: ActiveScenario) { |
| 48 | return Effect.gen(function* () { |
| 49 | const result = yield* callAuthProbe(scenario, "missing") |
| 50 | if (scenario.auth === "protected") { |
| 51 | if (result.status !== 401) throw new Error(`auth expected 401, got ${result.status}`) |
| 52 | const authed = yield* callAuthProbe(scenario, "valid") |
| 53 | if (authed.status === 401) throw new Error("auth rejected valid credentials") |
| 54 | return |
| 55 | } |
| 56 | |
| 57 | if (result.status === 401) throw new Error("auth expected public access, got 401") |
| 58 | if (result.timedOut) throw new Error("auth expected public access, probe timed out") |
| 59 | }) |
| 60 | } |
| 61 | |
| 62 | function withContext<A, E>( |
| 63 | options: Options, |
no test coverage detected