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

Function validateTestStepList

test/contract/p4-schema.test.ts:168–179  ·  view source on GitHub ↗
(value: unknown, label = 'TestStepList')

Source from the content-addressed store, hash-verified

166}
167
168function validateTestStepList(value: unknown, label = 'TestStepList'): void {
169 expect(value, `${label}: must be an object`).toBeTypeOf('object');
170 const obj = value as Record<string, unknown>;
171 expectKeysMatch(obj, new Set(['items', 'nextToken']), label);
172 expect(Array.isArray(obj.items), `${label}.items`).toBe(true);
173 for (const [i, item] of (obj.items as unknown[]).entries()) {
174 validateTestStep(item, `${label}.items[${i}]`);
175 }
176 if (obj.nextToken !== null) {
177 expect(typeof obj.nextToken, `${label}.nextToken`).toBe('string');
178 }
179}
180
181function validateResultSummary(value: unknown, label: string): void {
182 expect(value, label).toBeTypeOf('object');

Callers 1

p4-schema.test.tsFile · 0.85

Calls 2

validateTestStepFunction · 0.85
expectKeysMatchFunction · 0.70

Tested by

no test coverage detected