Skip to content

Commit

Permalink
Added dup test
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Feb 11, 2020
1 parent acba414 commit c6a7829
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,19 @@ test('Packet defaults - PUBLISH, QoS 1', function (t) {
t.end()
})

test('Packet defaults - PUBLISH, dup=true', function (t) {
var instance = new Packet({ dup: true })
t.equal(instance.cmd, 'publish')
t.equal(instance.brokerId, undefined)
t.equal(instance.brokerCounter, 0)
t.equal(instance.topic, undefined)
t.deepEqual(instance.payload, Buffer.alloc(0))
t.equal(instance.qos, 0)
t.equal(instance.retain, false)
t.equal(instance.messageId, undefined)
t.end()
})

test('Packet copies over most data', function (t) {
var original = {
cmd: 'pubrel',
Expand Down

0 comments on commit c6a7829

Please sign in to comment.