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

Function applyFailedOnly

src/lib/bundle.ts:290–301  ·  view source on GitHub ↗
(ctx: CliFailureContext)

Source from the content-addressed store, hash-verified

288 * or when the existing window already matches.
289 */
290export function applyFailedOnly(ctx: CliFailureContext): CliFailureContext {
291 const failedIdx = ctx.result.failedStepIndex;
292 if (failedIdx === null) return ctx;
293 const inWindow = (idx: number) => Math.abs(idx - failedIdx) <= FAILED_ONLY_RADIUS;
294 const filteredSteps = ctx.steps.filter(s => inWindow(s.stepIndex));
295 const filteredEvidence = ctx.failure.evidence.filter(e => inWindow(e.stepIndex));
296 return {
297 ...ctx,
298 steps: filteredSteps,
299 failure: { ...ctx.failure, evidence: filteredEvidence },
300 };
301}
302
303/**
304 * Resolve the user-supplied `--out` path into an absolute directory.

Callers 2

writeBundleFunction · 0.85
bundle.test.tsFile · 0.85

Calls 1

inWindowFunction · 0.85

Tested by

no test coverage detected