import type { TestRunner } from '../../../../infra/isomorph.test/detectTestRunner'; import type { RepeatableScope } from '../../../registryDescribeRepeatable'; import type { ExpectSnapshotState } from '../getOneExpectSnapshotState'; /** * .what = the slice of a vitest task this code reads: its name and its parent * .why = vitest derives a snapshot key from the task chain, so the chain is the lever */ export interface VitestTaskNamed { name: string; suite?: VitestTaskNamed; file?: unknown; } /** * .what = points the snapshot key of the test under way at its ordinal-free name * .why = every attempt must check one baseline. the reported test name keeps its * `, attempt N`, so a human still reads which attempt ran * * .note = each runner derives the key differently, so each has its own lever: * - jest keys on `currentConcurrentTestName?.() ?? currentTestName`, both on * the expect state (jest-snapshot `_toMatchSnapshot`) — so both are pointed * at the stripped name for the body, and both restored after, so a * consumer's own hook that reads the name still sees the real one * - vitest keys on the task chain's names (`getNames(task).slice(1)`), read at * each `toMatchSnapshot` call — so the attempt suites are renamed for the * body, and restored after, before the reporter reads them * * @returns the stripped name the key now carries, and a restore for the vitest rename */ export declare const setSnapshotKeyStripped: (input: { runner: TestRunner; snap: ExpectSnapshotState; scopes: RepeatableScope[]; task: VitestTaskNamed | null; }) => { nameStripped: string; restore: () => void; };