(is_async?: boolean)
| 328 | |
| 329 | test("async validation multiple errors 2", async () => { |
| 330 | const base = (is_async?: boolean) => |
| 331 | z.object({ |
| 332 | hello: z.string(), |
| 333 | foo: z.object({ |
| 334 | bar: z.number().refine( |
| 335 | is_async |
| 336 | ? async () => |
| 337 | new Promise((resolve) => { |
| 338 | setTimeout(() => resolve(false), 500); |
| 339 | }) |
| 340 | : () => false |
| 341 | ), |
| 342 | }), |
| 343 | }); |
| 344 | |
| 345 | const testval = { hello: 3, foo: { bar: 4 } }; |
| 346 | const result1 = base().safeParse(testval); |
no test coverage detected