/** * .what = registry and stack for repeatably context lookup * .why = enables explicit context lookup by describe path instead of implicit global */ /** * .what = get current describe path as lookup key * .why = used by then/useBeforeAll to find their repeatably context */ export declare const getDescribePath: () => string; /** * .what = state shape for repeatably context * .why = tracks success and failure across attempts */ export interface RepeatableState { /** * .what = the criteria for this repeatably block * .why = determines whether skip-on-success applies (SOME) or not (EVERY) */ criteria: 'EVERY' | 'SOME'; /** * .what = whether any prior attempt has passed * .why = used to skip subsequent attempts (only when criteria is SOME) */ anyAttemptPassed: boolean; /** * .what = whether the current attempt has failed * .why = used to determine if this attempt should mark success */ thisAttemptFailed: boolean; /** * .what = which attempt number is active now * .why = used to determine if we should throw on failure (only on final attempt) */ thisAttemptIndex: number; /** * .what = total number of attempts configured * .why = used to determine if current attempt is final */ allAttemptsQuant: number; /** * .what = error encountered in any failed attempt * .why = preserve error to throw on final attempt if all fail */ anyError: Error | null; } /** * .what = one repeatable block an attempt runs inside, by its two names * .why = a snapshot key must not carry the attempt ordinal, so every attempt checks * against one baseline. the scope names the exact text to strip from the key * * @example * { nameAttempt: 'when: the ask, attempt 2', nameBase: 'when: the ask' } */ export interface RepeatableScope { /** * .what = the registered name, with the attempt ordinal * .why = the exact span of text a snapshot key carries today */ nameAttempt: string; /** * .what = the name without the attempt ordinal * .why = the span of text the key must carry instead */ nameBase: string; } /** * .what = get the repeatable scopes that enclose the block under registration * .why = then() captures them at registration, for use when its test runs */ export declare const getCurrentRepeatableScopes: () => RepeatableScope[]; /** * .what = set the repeatable scopes that enclose the block under registration * .why = called by the repeatably describes and the nested describe wrappers */ export declare const setCurrentRepeatableScopes: (scopes: RepeatableScope[]) => void; /** * .what = registry for repeatably state keyed by describe path * .why = explicit scope — state is looked up by path, not implicit global */ export declare const registryDescribeRepeatable: Map; /** * .what = get current repeatably context * .why = used by then() to find context when describeStack path doesn't match */ export declare const getCurrentRepeatableContext: () => RepeatableState | null; /** * .what = set current repeatably context * .why = called by genDescribeRepeatable and nested describe wrappers */ export declare const setCurrentRepeatableContext: (ctx: RepeatableState | null) => void; /** * .what = find repeatably context via path hierarchy traversal * .why = nested blocks (when inside given.repeatably) need to find parent context * * @example * // registry has: "given: desc, attempt 1" * // path is: "given: desc, attempt 1 > when: test runs" * // returns: state registered at "given: desc, attempt 1" */ export declare const findRepeatableContext: (path: string) => RepeatableState | undefined; /** * .what = wraps describe callback with stack management and context propagation * .why = vitest defers describe callbacks; this ensures describeStack + repeatably context * are correctly tracked at execution time, not registration time */ export declare const wrapDescribeCallback: (input: { name: string; fn: () => void; }) => (() => void);