ContractTestOptions
●tagtree · /core·interface
Configuration passed to runAdapterContract; declares how to create and tear down the adapter
under test and which optional protocol features the adapter supports.
Properties
PROPTYPEDESCRIPTION
create
Factory that returns a fresh adapter instance for each individual test case.
name
string
Label used in the Vitest ``describe`` block to identify the adapter under test.
supportsStalenessGuard?
boolean
Set to ``true`` if the adapter honors ``WriteOpts.writeIfNewerThan``; enables the staleness-guard suite.
supportsTtl?
boolean
Set to ``true`` if the adapter enforces TTL-based expiry; enables the TTL test suite.
teardown?
Optional cleanup hook called after each test to release adapter resources such as connections.
Example
runAdapterContract({
name: 'memory',
create: () => memoryAdapter(),
supportsTtl: true,
supportsStalenessGuard: true,
});Related
runAdapterContract AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape EntityDecl
MetadataOpen in GitHub ↗
computeFanout
Expands a single entity reference into its full set of invalidation tags, from the mostspecific leaf tag down to the namespace root, following the hierarchy dec
createCacheInstance
Wires a CacheSchema definition to a storage adapter and returns a typed CacheInstance ready for read, write, and invalidate operations.