Skip to main content
Version: Current

runStoreTck

@rotorsoft/act-root


@rotorsoft/act-root / act-tck/src / runStoreTck

Function: runStoreTck()

runStoreTck(options): void

Defined in: libs/act-tck/src/store-tck.ts:188

Runs the Store contract test compatibility kit against the implementation produced by options.factory.

The TCK is the executable definition of the Store contract. Every method on the interface in libs/act/src/types/ports.ts has matching cases here:

  • commit โ€” single + multi-event commits, optimistic concurrency
  • query โ€” stream, names, correlation, before, after, created_after, created_before, limit, with_snaps, stream_exact, backward traversal
  • stream filter grammar โ€” the portable regex subset (^, $, ., .*, literal characters) matches identically everywhere; richer patterns either match with full regex semantics or throw ValidationError โ€” never a silent approximation
  • subscribe โ€” idempotent re-subscribe, watermark return value
  • claim / ack โ€” lease lifecycle, dual frontiers, leased streams not double-claimed, exact-source has-work matching, timed-out-lease retry accounting
  • block โ€” blocked streams hidden from claim, only same-drainer can block
  • reset โ€” restart watermarks (including blocked), no-op for missing
  • prioritize โ€” bulk priority updates by filter
  • truncate โ€” snapshot vs tombstone seeding, empty inputs, missing streams; windowed boundaries (before/max_id) โ€” prefix deleted behind the closest safe snapshot, tail + subscriptions kept, no-snapshot no-op, mixed full + windowed targets
  • query_streams โ€” filters, exact-match, pagination, blocked
  • notify (capability-gated) โ€” cross-instance delivery, self-filtering (an instance never receives its own commits), one notification per commit transaction with the full event batch

Tests namespace their streams with a per-test uid so the suite is parallel-safe against a shared backing store (e.g., a real Postgres instance running tests for the whole monorepo concurrently).

Parametersโ€‹

optionsโ€‹

StoreTckOptions

Returnsโ€‹

void

Exampleโ€‹

import { runStoreTck } from "@rotorsoft/act-tck";
import { InMemoryStore } from "@rotorsoft/act";

runStoreTck({
name: "InMemoryStore",
factory: () => new InMemoryStore(),
});