Skip to main content

protocol/testing

packages/protocol/src/testing

Purpose

Public barrel for protocol testing utilities. @moltzap/protocol/testing — test fixtures, typed lifecycle clients, arbitrary derivation, and Toxiproxy adversity helpers.

Public surface

agentId

Function

agentKeyArbitrary

Variable

agentKeyString

Function

agentKeyStringArbitrary

Variable

AgentRegistrationError

Class
HTTP registration failed (network, non-2xx, malformed response).

appId

Function

connectionId

Variable

contactId

Function

conversationId

Function

leaseId

Function

makeTestAgentClient

Function

makeTestAppClient

Function

messageId

Function

mintTestAppCredential

Function
Register an app manifest against the real server’s HTTP endpoint and return the server-minted { appId, appKey } (the appId is gen_random_uuid(), NOT manifest.appId). The App-principal sibling of registerTestAgent; the appKey is handed to a TestClient whose appKey Connect arm binds an AppConnection through the implicit moderator-endpoint registration path.

RealServerAcquireError

Class
Consumer-supplied real-server factory threw or returned an unusable handle.

redactedAgentKey

Function

redactedAppKey

Function

registerTestAgent

Function

RpcResponseError

Class
Server returned a typed error for a request.

RpcTimeoutError

Class
Wall-clock deadline for a request expired before a response.

taskId

Function

TestAgent

Interface

TestAgentClient

Interface

TestAppClient

Interface

TestAppCredential

Interface
Server-minted app principal credentials.

TestAppHttpRegistrationError

Class
HTTP app registration failed (network, non-2xx, malformed response).

TestingError

TypeAlias

TestServer

Interface

TransportClosedError

Class
Peer closed the underlying WS before a response arrived.

TransportIoError

Class
Underlying transport raised (socket error, DNS, TLS, etc.).

userId

Function

waitForValue

Function
Poll probe until it returns a defined value, then return it.

waitUntil

Function
Poll predicate until it returns true.

WIRE_ERROR_TAG

Variable

Files

  • errors.ts
  • lifecycle.ts
  • test-fixtures.ts
  • wait.ts
  • wire-error-tags.ts