Skip to content

IStore

Defined in: packages/core/src/types.ts:125

Storage backend interface. All methods are async so implementations can use any backend — SQLite, Supabase, Postgres, or custom.

Implementations MUST wrap any driver-level error thrown by a public method in a StoreError with package, method, message, and cause set so callers receive a uniform error shape and the original stack stays inspectable via error.cause. Validation errors from arktype (thrown via ValidationError) propagate unwrapped so bad input is distinguishable from a downstream driver failure.

close(): Promise<void>

Defined in: packages/core/src/types.ts:165

Release pooled connections and file handles.

Promise<void>


getNewPatterns(options?): Promise<object[]>

Defined in: packages/core/src/types.ts:147

Returns tests that newly crossed the flakiness threshold — failures in the current window but none in the prior window of the same length.

GetNewPatternsOptions

Promise<object[]>


getRecentRuns(options): Promise<RecentRun[]>

Defined in: packages/core/src/types.ts:155

Return the most recent runs ordered by startedAt descending. Filters by options.project the same way getNewPatterns does — pass a project string to isolate one project’s history, or leave undefined / null to match rows with NULL project. Used by the HTML report so users see run history even when there are no newly-flaky patterns.

GetRecentRunsOptions

Promise<RecentRun[]>


insertFailure(input): Promise<void>

Defined in: packages/core/src/types.ts:136

Record a single test failure against an existing run.

number | null

string | null

string | null

string

"unknown" | "assertion" | "timeout" | "uncaught"

string

string

string

Promise<void>


insertFailures(inputs): Promise<void>

Defined in: packages/core/src/types.ts:142

Insert multiple failures in a single transaction. Falls back to sequential inserts for backends that don’t support transactions. Preferred over calling insertFailure() in a loop for remote stores.

readonly object[]

Promise<void>


insertRun(input): Promise<void>

Defined in: packages/core/src/types.ts:132

Record the start of a run — paired with updateRun at completion.

boolean | null

string | null

string | null

string

string | null

string

string | null

Promise<void>


listFailures(options): Promise<FailureRow[]>

Defined in: packages/core/src/types.ts:163

Raw failure rows used by the HTML report to build kind breakdowns, hot-file lists, and per-run drill-downs. The primitive every adapter exposes — grouping and summarising happens in core so the logic lives in one place. Respects MAX_FAILED_TESTS_PER_RUN by default; set excludeInfraBlowups: false to disable.

ListFailuresOptions

Promise<FailureRow[]>


migrate(): Promise<void>

Defined in: packages/core/src/types.ts:130

Create tables and run any pending schema migrations. Idempotent — safe to call on every startup.

Promise<void>


updateRun(runId, input): Promise<void>

Defined in: packages/core/src/types.ts:134

Finalize a previously-inserted run with terminal status and counts.

string

number

string

number

number

number

"pass" | "fail"

number

Promise<void>