@end-close/relay-store-contract
v0.13.0
Published
Behavioural test suite every @end-close/relay EventStore implementation must pass (vitest).
Maintainers
Readme
@end-close/relay-store-contract
The behavioural test suite every @end-close/relay
EventStore implementation must pass. It is what @end-close/relay-sqlite and the built-in memory
store are tested against; a store that passes it works with the engine.
npm install --save-dev @end-close/relay-store-contract vitestPeer dependencies: @end-close/relay (same version as this package) and vitest >=3. This is a
test-only package; it has no runtime use.
Usage
// my-store.test.ts
import { describeEventStoreContract } from '@end-close/relay-store-contract'
import { MyEventStore } from './my-store.js'
describeEventStoreContract(
'my-store',
async () => new MyEventStore(await openFreshDb()), // a fresh, empty store per test
async (store) => store.close(), // optional cleanup
)The suite exercises insert/claim/settle semantics, lease-based claiming across instances,
recovery of expired leases, parking and replay, retention pruning and the EventStoreAdmin
listing methods. Your store must implement both EventStore and EventStoreAdmin.
Requires Node >=22.12.
See COMPATIBILITY.md
for the store interfaces' stability guarantees.
