0.0.22 • Published 2 years ago
@node-ts/bus-test v0.0.22
@node-ts/bus-test
This package provides a common suite of tests for @node-ts/bus that help to ensure consistency across packages that extend the library by adding a new transport adapter.
The package expects that jest is used as the test runner.
Installation
Add this to your transport or persistence package:
npm i @node-ts/bus-test --save-devImplementation
Transport tests are run by creating a describe() block and calling transportTests() with the following parameters:
- transport - A fully configured transport that's the subject under test
- publishSystemMessage - A callback that will publish a
@node-ts/bus-test:TestSystemMessagewith asystemMessageattribute set to the value of thetestSystemAttributeValueparameter - systemMessageTopicIdentifier - An optional system message topic identifier that identifies the source topic of the system message
- readAllFromDeadLetterQueue - A callback that will read and delete all messages on the dead letter queue
Example
Examples of how to implement the standard transport tests can be viewed by looking at existing implementations such as: