Skip to main content
Version: Current

runCacheTck

@rotorsoft/act-root


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

Function: runCacheTck()

runCacheTck(options): void

Defined in: libs/act-tck/src/cache-tck.ts:64

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

Covers the full Cache surface defined in libs/act/src/types/ports.ts:

  • get/set round-trip
  • get on a missing key returns undefined
  • invalidate removes a single stream without affecting others
  • clear wipes all entries
  • dispose is idempotent and awaitable
  • cross-stream isolation

Adapter-specific behavior (LRU ordering, TTL, size limits, โ€ฆ) stays in the adapter's own test suite โ€” the TCK only asserts the contract every Cache must honor.

Parametersโ€‹

optionsโ€‹

CacheTckOptions

Returnsโ€‹

void

Exampleโ€‹

import { runCacheTck } from "@rotorsoft/act-tck";
import { InMemoryCache } from "@rotorsoft/act";

runCacheTck({
name: "InMemoryCache",
factory: () => new InMemoryCache({ maxSize: 1000 }),
});