Skip to content

Graphorin API reference v0.8.0


Graphorin API reference / @graphorin/channels / testkit

testkit

@graphorin/channels/testkit - conformance suite + in-memory building blocks for adapter authors and application tests.

Interfaces

InterfaceDescription
ConformanceHarnessHooks the suite uses to drive the adapter under test. sendInbound must make the adapter produce ONE inbound message (for a real vendor adapter: through the vendor fake; the loopback adapter's inject satisfies it directly).
ConformanceTestApiThe subset of the vitest/jest API the conformance suite needs - injected so this module has no test-framework dependency.
LoopbackAdapterThe in-memory loopback adapter: a full ChannelAdapter whose transport is the test itself. Tests inject() inbound messages and read deliveries for what the gateway sent back.
LoopbackAdapterOptionsOptions for createLoopbackAdapter.
LoopbackInboundInputConvenience shape for LoopbackAdapter.inject.

Functions

FunctionDescription
createInMemoryPairingStoreIn-memory PairingStore for tests and single-process prototypes. Mirrors the sqlite implementation's semantics (one pending request per peer, per-channel code uniqueness by construction).
createLoopbackAdapterBuild a loopback adapter for tests and prototypes.
describeChannelAdapterConformanceRegister the conformance suite against a harness.