Skip to content

Commit

Permalink
Added test on unrecognised params in sub packet structure (#455)
Browse files Browse the repository at this point in the history
* Added test on unrecognized params in sub packet

* Added assertion
  • Loading branch information
gnought authored Mar 3, 2020
1 parent 05d2ee3 commit 76cdd8e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,28 @@ test('emit subscribe event', function (t) {
})
})

test('emit subscribe event if unrecognized params in subscribe packet structure', function (t) {
t.plan(3)

const broker = aedes()
t.tearDown(broker.close.bind(broker))

const s = noError(connect(setup(broker)))
const subs = [{ topic: 'hello', qos: 0 }]

broker.on('subscribe', function (subscriptions, client) {
t.equal(subscriptions, subs)
t.deepEqual(client, s.client)
})

s.client.subscribe({
subscriptions: subs,
restore: true
}, function (err) {
t.error(err)
})
})

test('emit unsubscribe event', function (t) {
t.plan(6)

Expand Down

0 comments on commit 76cdd8e

Please sign in to comment.