Skip to content

Commit

Permalink
Enhance auth QoS 0 tests (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnought authored and mcollina committed Jul 19, 2019
1 parent 565d710 commit 9bac5eb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ test('authentication error when non numeric return code is passed', function (t)
})

test('authorize publish', function (t) {
t.plan(3)
t.plan(4)

var s = connect(setup())
var expected = {
Expand All @@ -330,6 +330,7 @@ test('authorize publish', function (t) {
}

s.broker.mq.on('hello', function (packet, cb) {
t.notOk(Object.prototype.hasOwnProperty.call(packet, 'messageId'), 'should not contain messageId in QoS 0')
expected.brokerId = s.broker.id
expected.brokerCounter = s.broker.counter
delete expected.dup
Expand All @@ -346,7 +347,7 @@ test('authorize publish', function (t) {
})

test('authorize waits for authenticate', function (t) {
t.plan(5)
t.plan(6)

var s = setup()

Expand Down Expand Up @@ -376,6 +377,7 @@ test('authorize waits for authenticate', function (t) {
}

s.broker.mq.on('hello', function (packet, cb) {
t.notOk(Object.prototype.hasOwnProperty.call(packet, 'messageId'), 'should not contain messageId in QoS 0')
expected.brokerId = s.broker.id
expected.brokerCounter = s.broker.counter
delete expected.dup
Expand Down Expand Up @@ -403,7 +405,7 @@ test('authorize waits for authenticate', function (t) {
})

test('authorize publish from configOptions', function (t) {
t.plan(3)
t.plan(4)

var s = connect(setup(aedes({
authorizePublish: function (client, packet, cb) {
Expand All @@ -424,6 +426,7 @@ test('authorize publish from configOptions', function (t) {
}

s.broker.mq.on('hello', function (packet, cb) {
t.notOk(Object.prototype.hasOwnProperty.call(packet, 'messageId'), 'should not contain messageId in QoS 0')
expected.brokerId = s.broker.id
expected.brokerCounter = s.broker.counter
delete expected.dup
Expand Down

0 comments on commit 9bac5eb

Please sign in to comment.