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

Function validateFixTarget

test/contract/p5-schema.test.ts:74–83  ·  view source on GitHub ↗
(value: unknown, label = 'FixTarget')

Source from the content-addressed store, hash-verified

72}
73
74function validateFixTarget(value: unknown, label = 'FixTarget'): asserts value is CliFixTarget {
75 expect(value, `${label}: must be an object`).toBeTypeOf('object');
76 expect(value, `${label}: not null`).not.toBeNull();
77 const obj = value as Record<string, unknown>;
78 expectRequired(obj, FIX_TARGET_REQUIRED, label);
79 expectKeysMatch(obj, new Set(FIX_TARGET_REQUIRED), label);
80 expect(FIX_KINDS.has(obj.kind), `${label}.kind`).toBe(true);
81 expectStringOrNull(obj.reference, `${label}.reference`);
82 expectStringOrNull(obj.rationale, `${label}.rationale`);
83}
84
85function validateEvidence(value: unknown, label = 'Evidence'): asserts value is CliEvidence {
86 expect(value, `${label}: must be an object`).toBeTypeOf('object');

Callers 1

validateFailureBlockFunction · 0.85

Calls 3

expectRequiredFunction · 0.70
expectKeysMatchFunction · 0.70
expectStringOrNullFunction · 0.70

Tested by

no test coverage detected