( value: Record<string, unknown>, required: ReadonlyArray<string>, label: string, )
| 57 | } |
| 58 | |
| 59 | function expectRequired( |
| 60 | value: Record<string, unknown>, |
| 61 | required: ReadonlyArray<string>, |
| 62 | label: string, |
| 63 | ) { |
| 64 | for (const field of required) { |
| 65 | expect(field in value, `${label}: missing required field "${field}"`).toBe(true); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | function expectStringOrNull(v: unknown, label: string) { |
| 70 | if (v === null) return; |
no outgoing calls
no test coverage detected