MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / validateResultSummary

Function validateResultSummary

test/contract/p4-schema.test.ts:181–190  ·  view source on GitHub ↗
(value: unknown, label: string)

Source from the content-addressed store, hash-verified

179}
180
181function 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
192function validateLatestResult(value: unknown, label = 'LatestResult'): void {
193 expect(value, `${label}: must be an object`).toBeTypeOf('object');

Callers 1

validateLatestResultFunction · 0.85

Calls 1

expectKeysMatchFunction · 0.70

Tested by

no test coverage detected