()
| 140 | |
| 141 | test("mayFail2 error", () => { |
| 142 | function myFunc(): Result<number, string> { |
| 143 | return safeTry<number, string>(function*() { |
| 144 | return ok( |
| 145 | (yield* good() |
| 146 | .mapErr(e => `1st, ${e}`) |
| 147 | .safeUnwrap()) |
| 148 | + |
| 149 | (yield* bad() |
| 150 | .mapErr(e => `2nd, ${e}`) |
| 151 | .safeUnwrap()) |
| 152 | ) |
| 153 | }) |
| 154 | } |
| 155 | |
| 156 | const result = myFunc() |
| 157 | expect(result.isErr()).toBe(true) |
no test coverage detected
searching dependent graphs…