| 209 | ) |
| 210 | |
| 211 | const assertTypedFailure = <A, E>(exit: Exit.Exit<A, E>, error: E) => { |
| 212 | assert.isTrue(Exit.isFailure(exit)) |
| 213 | if (!Exit.isFailure(exit)) { |
| 214 | return |
| 215 | } |
| 216 | assert.isFalse( |
| 217 | Cause.hasDies(exit.cause), |
| 218 | `expected a typed failure but the cause contains a defect:\n${Cause.pretty(exit.cause)}` |
| 219 | ) |
| 220 | assert.deepStrictEqual(Cause.findErrorOption(exit.cause), Option.some(error)) |
| 221 | } |
| 222 | |
| 223 | /** Collects every span a traced effect creates, in the order they start. */ |
| 224 | const recording = () => { |