@xtandard/kit/storage/testing — the shared storage conformance suite. The test API is
injected ({ describe, test, expect } from vitest, bun:test, …), so products run the same
cases against their wrapped drivers and register extra suites with runConformanceCases.
An in-memory node-redis look-alike: string and RedisJSON values, the driver’s two Lua scripts emulated, a SCAN that yields every key twice (Redis may repeat keys), and PSUBSCRIBE with real glob matching (so an unescaped prefix would miss events).
Register describe(title, …) with one test per case. Each test gets a fresh storage from make. This is how products register their own extra suites next to runStorageConformance.
Register the full conformance suite for one driver: the base contract, plus the compare-and-swap and watch cases when capabilities says the driver has them.
The optional capabilities the driver under test implements. Declare each one: a capability case checks the declaration against the storage itself, so a driver that implements compareAndSwap or watch without declaring it (or declares one it lacks) fails instead of silently skipping cases. Pass false for a capability the driver doesn’t have.
Write a value in a legacy, non-canonical stored form, bypassing the driver (e.g. a raw SQL INSERT of json text with unsorted keys, a Mongo document with fields in insertion order). Enables the legacy-value CAS case (ADR 0005).
The declared capabilities match the storage: an undeclared compareAndSwap or watch would skip those cases silently, and a declared one the storage lacks would fail them obscurely.