Skip to content

Commit

Permalink
✨ validate implementation & type definitions of new sender events
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-runge committed Aug 4, 2024
1 parent 0c2de27 commit 0e0d4ec
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ describe('Receiver & Sender (integration test)', () => {
try {
const received: Packet[] = [];
const errors: Error[] = [];
const receivedEvents: boolean[] = [];
Tx.on('changedResendStatus', (event) => receivedEvents.push(event));
Tx.on('error', (ex) => errors.push(ex));
Rx.on('packet', (packet) => received.push(packet));
collectErrors(Rx, errors);

Expand All @@ -58,6 +61,8 @@ describe('Receiver & Sender (integration test)', () => {

assert.strictEqual(errors.length, 0);
assert.strictEqual(received.length, 4); // send at 0s, 1s, 2s, 3s. Then at 3.5s we stop
assert.strictEqual(receivedEvents.length, 1);
assert.deepStrictEqual(receivedEvents[0], true);
assert.deepStrictEqual(received[0]!.payload, { 1: 100 });
assert.deepStrictEqual(received[1]!.payload, { 1: 100 });
assert.deepStrictEqual(received[2]!.payload, { 1: 100 });
Expand Down

0 comments on commit 0e0d4ec

Please sign in to comment.