(s: string)
| 231 | it("mapOrFail supports effectful validation", async () => { |
| 232 | const config = Config.schema(Schema.String) |
| 233 | const f = (s: string) => |
| 234 | s === "" |
| 235 | ? Effect.fail( |
| 236 | new Config.ConfigError( |
| 237 | new Schema.SchemaError(new SchemaIssue.InvalidValue({ message: "empty" })) |
| 238 | ) |
| 239 | ) |
| 240 | : Effect.succeed(s.toUpperCase()) |
| 241 | |
| 242 | await assertSuccess( |
| 243 | Config.mapOrFail(config, f), |