Skip to content

TransportContractWorld

Defined in: console-sdk/src/testing/describeTransportContract.ts:32

What one contract-suite test needs from the transport under test. The simulated world provides everything cheaply; a hardware lane provides the same shape with real waiting and a real console, and may omit the optional capabilities (their assertions are skipped).

discoverableDevice(): DeviceId | Promise<DeviceId>

Defined in: console-sdk/src/testing/describeTransportContract.ts:36

A device that scans and connects; resolves its transport id.

DeviceId | Promise<DeviceId>


optional dropLink(deviceId): void

Defined in: console-sdk/src/testing/describeTransportContract.ts:44

Optional: force an unexpected link drop.

DeviceId

void


optional emitFrame(deviceId): void

Defined in: console-sdk/src/testing/describeTransportContract.ts:42

Optional: make the device emit one inbound frame.

DeviceId

void


unreachableDevice(): DeviceId | Promise<DeviceId>

Defined in: console-sdk/src/testing/describeTransportContract.ts:38

A device id that can never connect (drives the timeout contract).

DeviceId | Promise<DeviceId>


wait(ms): Promise<void>

Defined in: console-sdk/src/testing/describeTransportContract.ts:40

Advance time by ms — simulated clock in CI, real waiting on hardware.

number

Promise<void>

readonly transport: ConsoleTransport

Defined in: console-sdk/src/testing/describeTransportContract.ts:34

The factory under test — the suite invokes it with its own delegate.