Skip to content

API reference / @node-ts/bus-test / transportTests

Function: transportTests() ​

ts
function transportTests(
   transport, 
   publishSystemMessage, 
   systemMessageTopicIdentifier, 
   readAllFromDeadLetterQueue
): void;

Defined in: bus-test/src/transport-tests.ts:36

A suite of tests that get wrapped by the integration test setup/tear-down of an implementation of a transport. The suite sends messages with nested types (Dates, class instances, arrays, Maps, Sets, optional and null fields) and checks they arrive with their types restored, so the transport must (de)serialize messages through coreDependencies.messageSerializer.

Parameters ​

ParameterTypeDescription
transportTransportA fully configured transport that's the subject under test
publishSystemMessage(testSystemAttributeValue) => Promise<void>A callback that will publish a @node-ts/bus-test:TestSystemMessage with a systemMessage attribute set to the value of the testSystemAttributeValue parameter
systemMessageTopicIdentifierstring | undefinedAn optional system message topic identifier that identifies the source topic of the system message
readAllFromDeadLetterQueue() => Promise<object[]>A callback that will read and delete all messages on the dead letter queue

Returns ​

void

Released under the MIT License.