Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
added retain flag to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Zangl committed Apr 4, 2017
1 parent 434816d commit 5bf923e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/zeromq_ascoltatore.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ZeromqAscoltatore.prototype._startControl = function() {
}, 250);

that._control_conn.on("message", function(data) {
var dest = String(data)
var dest = String(data);
debug("received connect response from " + dest);
if (that._sub_conns.findIndex(function (conn) {
return conn.port === dest;
Expand Down
3 changes: 2 additions & 1 deletion test/mqtt_ascoltatore_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ describeAscoltatore("MQTT", function() {
var that = this;
mqttServer.once('published', function(packet) {
expect(packet.qos).to.eql(0);
expect(packet.retain).to.eql(true);
done();
});
that.instance.publish("hello/123", "42", { qos: 0 });
that.instance.publish("hello/123", "42", { qos: 0, retain: true });
});

});
Expand Down
8 changes: 4 additions & 4 deletions test/zeromq_ascoltatore_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ describeAscoltatore("zeromq", function() {
if (--count === 0) {
instance._control_conn.removeListener("message", donner);

var subs = {}
var subs = {};
instance._sub_conns.forEach(function(c) {
subs[c.port] = true;
});
expect(instance._sub_conns.length).to.equal(3);
expect(Object.keys(subs).length).to.equal(3);

subs = {}
subs = {};
other._sub_conns.forEach(function(c) {
subs[c.port] = true;
});
expect(other._sub_conns.length).to.equal(3);
expect(Object.keys(subs).length).to.equal(3);

subs = {}
subs = {};
other2._sub_conns.forEach(function(c) {
subs[c.port] = true;
});
Expand Down Expand Up @@ -135,7 +135,7 @@ describeAscoltatore("zeromq", function() {
instance.connect(other._opts.controlPort);
instance.connect(other2._opts.controlPort);
instance._control_conn.on("message", donner);
cb()
cb();
}
]);
});
Expand Down

0 comments on commit 5bf923e

Please sign in to comment.