(value: unknown, label: string)
| 179 | } |
| 180 | |
| 181 | function validateResultSummary(value: unknown, label: string): void { |
| 182 | expect(value, label).toBeTypeOf('object'); |
| 183 | expect(value, label).not.toBeNull(); |
| 184 | const obj = value as Record<string, unknown>; |
| 185 | expectKeysMatch(obj, new Set(['passed', 'failed', 'skipped']), label); |
| 186 | for (const k of ['passed', 'failed', 'skipped']) { |
| 187 | expect(typeof obj[k], `${label}.${k}`).toBe('number'); |
| 188 | expect((obj[k] as number) >= 0, `${label}.${k} >= 0`).toBe(true); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | function validateLatestResult(value: unknown, label = 'LatestResult'): void { |
| 193 | expect(value, `${label}: must be an object`).toBeTypeOf('object'); |
no test coverage detected