Skip to content

Commit

Permalink
test dedupe subs and qos 128 in subscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Apr 9, 2020
1 parent 462695f commit b191c8d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions test/client-pub-sub.js
Expand Up @@ -714,7 +714,7 @@ test('get message when client disconnects', function (t) {
})

test('should not receive a message on negated subscription', function (t) {
t.plan(2)
t.plan(4)

const broker = aedes()
t.tearDown(broker.close.bind(broker))
Expand All @@ -731,15 +731,24 @@ test('should not receive a message on negated subscription', function (t) {
retain: true
}, function (err) {
t.error(err, 'no error')
client.subscribe({
client.subscribe([{
topic: 'hello',
qos: 0
}, function (err) {
},
{
topic: 'hello',
qos: 0
}], function (err) {
t.error(err, 'no error')
})
})
})

broker.on('subscribe', function (subs) {
t.pass(subs.length, 1, 'Should dedupe subs')
t.pass(subs[0].qos, 128, 'Qos should be 128 (Fail)')
})

const s = connect(setup(broker))
s.outStream.once('data', function (packet) {
t.fail('Packet should not be received')
Expand Down

0 comments on commit b191c8d

Please sign in to comment.