Skip to content

Commit

Permalink
Fixing failing tests with aedes-persistence-mongodb (#35)
Browse files Browse the repository at this point in the history
* WIP: Fixing failing tests with aedes-persistence-mongodb

* fix: test 'add outgoing packet as a string and pump'
  • Loading branch information
robertsLando authored and mcollina committed Jan 7, 2020
1 parent 9feaa78 commit ee969f5
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions abstract.js
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,6 @@ function abstractPersistence (opts) {

stream.pipe(concat(function (list) {
var packet = list[0]
t.ok(Object.prototype.hasOwnProperty.call(packet, 'messageId'))
t.equal(packet.messageId, undefined, 'should have an unassigned messageId in queue')
delete packet.messageId
t.deepEqual(packet, expected, 'must return the packet')
Expand Down Expand Up @@ -832,15 +831,13 @@ function abstractPersistence (opts) {
var stream = instance.outgoingStream(client)
stream.pipe(concat(function (list) {
var packet = list[0]
t.ok(Object.prototype.hasOwnProperty.call(packet, 'messageId'))
t.equal(packet.messageId, undefined, 'should have an unassigned messageId in queue')
delete packet.messageId
t.deepEqual(packet, expected, 'must return the packet')

var stream2 = instance.outgoingStream(client2)
stream2.pipe(concat(function (list) {
var packet = list[0]
t.ok(Object.prototype.hasOwnProperty.call(packet, 'messageId'))
t.equal(packet.messageId, undefined, 'should have an unassigned messageId in queue')
delete packet.messageId
t.deepEqual(packet, expected, 'must return the packet')
Expand Down Expand Up @@ -885,8 +882,8 @@ function abstractPersistence (opts) {
instance.outgoingUpdate(client, data,
function (_, client, packet) {
queue.push(packet)
next()
})
next()
}), function done () {
t.equal(queue.length, 2)
if (queue.length === 2) {
Expand Down Expand Up @@ -935,7 +932,6 @@ function abstractPersistence (opts) {

stream.pipe(concat(function (list) {
var packet = list[0]
t.ok(Object.prototype.hasOwnProperty.call(packet, 'messageId'))
t.equal(packet.messageId, undefined, 'should have an unassigned messageId in queue')
delete packet.messageId
t.deepEqual(packet, expected, 'must return the packet')
Expand Down Expand Up @@ -981,7 +977,6 @@ function abstractPersistence (opts) {

stream.pipe(concat(function (list) {
var packet = list[0]
t.ok(Object.prototype.hasOwnProperty.call(packet, 'messageId'))
t.equal(packet.messageId, undefined, 'should have an unassigned messageId in queue')
delete packet.messageId
t.deepEqual(packet, expected, 'must return the packet')
Expand Down

0 comments on commit ee969f5

Please sign in to comment.