| 35 | } |
| 36 | |
| 37 | function expectBatchError(fn: () => unknown, title: string): BatchRenderInputError { |
| 38 | try { |
| 39 | fn(); |
| 40 | } catch (error: unknown) { |
| 41 | expect(error).toBeInstanceOf(BatchRenderInputError); |
| 42 | if (error instanceof BatchRenderInputError) { |
| 43 | expect(error.title).toBe(title); |
| 44 | return error; |
| 45 | } |
| 46 | } |
| 47 | throw new Error("Expected BatchRenderInputError"); |
| 48 | } |
| 49 | |
| 50 | function eventType(value: unknown): string | undefined { |
| 51 | if (value === null || typeof value !== "object" || Array.isArray(value)) return undefined; |