You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an unpublished package that's consumed by implementations of `transport` and `persistence` in order to integration test their behaviours and ensure they all do the same thing regardless of the underlying technology.
3
+
This package provides a common suite of tests for [@node-ts/bus](https://bus.node-ts.com) that help to ensure consistency across packages that extend the library by adding a new [transport](https://bus.node-ts.com/guide/transports) adapter.
4
+
5
+
The package expects that [jest](https://www.npmjs.com/package/jest) is used as the test runner.
6
+
7
+
## Installation
8
+
9
+
Add this to your transport or persistence package:
10
+
11
+
```sh
12
+
npm i @node-ts/bus-test --save-dev
13
+
```
14
+
15
+
## Implementation
16
+
17
+
Transport tests are run by creating a `describe()` block and calling `transportTests()` with the following parameters:
18
+
19
+
-**transport** - A fully configured transport that's the subject under test
20
+
-**publishSystemMessage** - A callback that will publish a `@node-ts/bus-test:TestSystemMessage` with a `systemMessage` attribute set to the value of the `testSystemAttributeValue` parameter
21
+
-**systemMessageTopicIdentifier** - An optional system message topic identifier that identifies the source topic of the system message
22
+
-**readAllFromDeadLetterQueue** - A callback that will read and delete all messages on the dead letter queue
23
+
24
+
### Example
25
+
26
+
Examples of how to implement the standard transport tests can be viewed by looking at existing implementations such as:
0 commit comments