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

Commit

Permalink
Fixed MQTT test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Apr 17, 2014
1 parent 7ae87ff commit 94062d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions test/common.js
Expand Up @@ -95,6 +95,7 @@ var mosca = require("mosca");

global.mqttServer = new mosca.Server({
port: 5883,
stats: false,
logger: {
level: "fatal"
}
Expand Down
10 changes: 4 additions & 6 deletions test/mqtt_ascoltatore_spec.js
Expand Up @@ -29,15 +29,13 @@ describeAscoltatore("MQTT", function() {
}
]);
});

it("should publish with options", function(done) {
var that = this;
that.instance.subscribe("hello/*", function(topic, value, options) {
expect(value).to.equal("42");
expect(options.qos).to.equal(0);
mqttServer.once('published', function(packet) {
expect(packet.qos).to.eql(0);
done();
}, function () {
that.instance.publish("hello/123", "42", { qos: 0 });
});
that.instance.publish("hello/123", "42", { qos: 0 });
});
});

0 comments on commit 94062d3

Please sign in to comment.