StateAdapterConformanceContext
TypeSignature
type StateAdapterConformanceContext = {
createNotifyAdapter?: () => MaybePromise<NotifyAdapter<Mode>>;
createStateAdapter: () => MaybePromise<StateAdapter<any, any, any, Mode>>;
withNonTransactionContext<T>(fn): MaybePromise<T>;
};core/src/conformance.state-adapter/types.ts:11
The context the state adapter conformance cases run against, for an adapter of either mode. Create it once, before the cases. Each case creates the adapters it needs from it, and they are closed when the case ends.
Properties
createNotifyAdapter?
Signature
createNotifyAdapter?: () => MaybePromise<NotifyAdapter<Mode>>;core/src/conformance.state-adapter/types.ts:25
Creates the notify adapter an end-to-end case shares; in-process when omitted.
Returns
MaybePromise<NotifyAdapter<Mode>>
createStateAdapter
Signature
createStateAdapter: () => MaybePromise<StateAdapter<any, any, any, Mode>>;core/src/conformance.state-adapter/types.ts:17
Creates an adapter over a clean state: no jobs, blockers or workers, such as by clearing the tables before returning the adapter. The adapters a case creates are closed when it ends, so closing one must not release resources the next one needs.
Returns
MaybePromise<StateAdapter<any,any,any,Mode>>
Methods
withNonTransactionContext()
Signature
withNonTransactionContext<T>(fn): MaybePromise<T>;core/src/conformance.state-adapter/types.ts:23
Runs the callback with a context of the adapter's shape that is not inside a transaction
(e.g. a pool client with no BEGIN, or the root ORM handle), so the suite can verify
isTransaction rejects it.
Type Parameters
- T
Parameters
- fn(
txCtx) =>MaybePromise<T>
Returns
MaybePromise<T>