Skip to content

Commit

Permalink
simple test for unsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinDmello committed Jul 13, 2017
1 parent 2a607ea commit b5fdf35
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/client-pub-sub.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,28 @@ test('subscribe a client programmatically', function (t) {
})
})

test('unsubscribe a client', function (t) {
t.plan(2)

var broker = aedes()

broker.on('client', function (client) {
client.subscribe({
topic: 'hello',
qos: 0
}, function (err) {
t.error(err, 'no error')
client.unsubscribe({
topic: 'hello',
qos: 0
}, function (err) {
t.error(err, 'no error')
})
})
})
connect(setup(broker))
})

test('subscribe a client programmatically multiple topics', function (t) {
t.plan(3)

Expand Down

0 comments on commit b5fdf35

Please sign in to comment.