The stub transport
stubTransport is exported from the runtime subpath and plugs into the transport option:
type, customerId, and timestamp with the fixed id msg_stub. Credentials still resolve before the stub runs, so tests exercise the production configuration path; any non-empty key satisfies it.
stubTransport is imported from @repost/client/runtime, not from the package root.Asserting on the full request
Use the native testing helper to assert on the serialized request and idempotency key. It implements the same one-attemptTransport interface as the production transport:
bodyText, bodyBytes, headers, attempt number, timeout, and idempotency key are captured from the actual runtime attempt.
Deterministic values
Pin the injectable generators to freeze timestamps and generated ids:now pinned, the envelope timestamp and every @default(now()) field are fixed.
Testing retry behavior
Queue failures and responses onScriptedStubTransport, then use deterministicClientOptions() or ManualClock from @repost/client/testing to advance retry delays without sleeping. Set maxAttempts, retryBaseDelayMs, and attemptTimeoutMs on the client; retries never live inside the transport.
Continue
Quickstart
The full setup, from install to first send.
Reliability
The behaviors these seams let you test.
Configuration
The options and transport seams in full.