import type { TestRunner } from '../../infra/isomorph.test/detectTestRunner'; import type { RepeatableScope, RepeatableState } from '../registryDescribeRepeatable'; import { type VitestTaskNamed } from './snapshot/key/setSnapshotKeyStripped'; /** * .what = the slice of vitest's test context this body reads * .why = vitest hands each test its task (the key lever) and a skip marker */ export interface VitestTestContext { task?: VitestTaskNamed & { id?: string; }; skip?: () => void; } /** * .what = builds the body of one test inside a repeatable block * .why = an attempt must check one snapshot baseline, and under `criteria: 'SOME'` a * non-final attempt must not fail the file, whatever failed in it — a throw, a * suppressed snapshot mismatch, or an overrun of the time budget * * .note = per attempt: * 1. skip, where a prior SOME attempt already passed * 2. strip the attempt ordinal from the snapshot key, and rebase its count * 3. run the body; under SOME, against the runner's own time budget * 4. name a renamed key, where the baseline predates the strip * 5. under SOME on a non-final attempt, withhold the failure and log it * 6. otherwise, surface the failure as the runner would */ export declare const genRepeatableTestBody: (input: { /** * .note = called with no args: a repeatable body takes no done callback */ testFn: (...args: never[]) => unknown; ctx: RepeatableState | null; scopes: RepeatableScope[]; runner: TestRunner; }) => (testContext: VitestTestContext | null) => Promise;