runAdapterContract
●tagtree · /core·function
Registers a Vitest describe block that verifies an adapter implementation satisfies the
CacheAdapter contract; call this inside each adapter package's own test suite to catch
behavioral regressions without duplicating test logic.
Signature
function runAdapterContract(opts: ContractTestOptions): void;Parameters
| Name | Type | Description |
|---|---|---|
opts | ContractTestOptions |
Example
import { runAdapterContract } from '@tagtree/core/contract-tests';
import { memoryAdapter } from '@tagtree/core';
runAdapterContract({
name: 'memory',
create: () => memoryAdapter(),
supportsTtl: true,
supportsStalenessGuard: true,
});Related
ContractTestOptions AdapterCtx CacheAdapter CacheInstance CacheKey CacheSchema CacheSchemaShape EntityDecl
MetadataOpen in GitHub ↗
QualifierConfig
Declares how a qualifier value (e.g., a locale or currency code) appends a ::key suffix to read tags, isolating cache entries for the same entity but different
TenantConfig
Declares how a tenant value maps to a cachekey prefix; the key function serializes the tenant to its string segment, while extraTags injects additional pertenan