Functions

f
build(config: Config): FailureCachePayload

Assembles the cache payload from the shared per-run failure slots on config.

f
filesToRerun(
projectRoot: string,
hasInputTargets: boolean,
fsTree: FSTree
): Promise<string[] | null>

Resolves the concrete previously-failing test files to re-run for --only-failed. Returns null when no cache exists (the caller picks the fallback — run all, or a full watch start). Otherwise returns the cached files that still exist, intersected with fsTree when input targets were given (so failures stay scoped to what the user asked for) or the full cached set when no targets were provided. Shared by the non-watch fsTree filter and the watch initial run.

f
read(projectRoot: string): Task<FailureCachePayload | null, never>

Reads the failure cache; returns null on a missing file or any parse/shape error.

f
record(
config: Config,
details: FailedTestDetails
): void

Records a failed testEnd into the shared per-run slots (state.results.failedFiles / failedTests) used to build the persistent cache. The failing file is attributed via source-map resolution of the first failing assertion's stack; when that can't be resolved to one of the run's test files (timeouts, no stack, a frame in a shared helper), the whole run/group set is added so a failure is never dropped from --only-failed.

f
write(
projectRoot: string,
cache: FailureCachePayload
): Promise<void>

Writes the failure cache. Best-effort; callers fire-and-forget like Timings.persist.

Interfaces

I
FailedTestRecord

One failed test, kept for display and future -t (test-name filter) wiring.

I
FailureCachePayload

On-disk shape of tmp/.qunitx-last-failures.json.