Skip to content

describeTransportContract

describeTransportContract(name, createWorld): void

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

Registers the shared ConsoleTransport seam-semantics suite (SDK_PLAN.md §4.8.2 item 5) against one transport implementation. Call at module scope of a test file:

string

display name of the implementation under test.

() => TransportContractWorld | Promise<TransportContractWorld>

builds a FRESH world per test (isolation is the caller’s contract; the suite never reuses a world across tests).

void

describeTransportContract('createSimulatedTransport', () => {
const transport = createSimulatedTransport({
consoles: [{ model: 'echo-rower', serial: '400123' }],
});
transport.addConsole({ model: 'echo-bike', serial: '888888' }).powerOff();
return {
transport,
discoverableDevice: () => transport.console('400123').id,
unreachableDevice: () => transport.console('888888').id,
wait: (ms) => transport.clock.advance(ms),
emitFrame: (id) => transport.console(id).emitFrame({}),
dropLink: (id) => transport.console(id).dropConnection(),
};
});