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

Commit

Permalink
Added test for QoS 0 messages and QoS 1 subscription.
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed May 22, 2013
1 parent 8e377ac commit f41c4f8
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/server_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,35 @@ describe("mosca.Server", function() {
});
});

it("should receive at QoS 0 all messages published at QoS 0 even if subscribed at QoS 1", function(done) {
buildAndConnect(done, function(client) {

client.once("publish", function(packet) {
expect(packet.qos).to.be.equal(0);
client.disconnect();
});

client.on("suback", function(packet) {
client.publish({
topic: "hello",
qos: 0,
messageId: 24
});
});

var subscriptions = [{
topic: "hello",
qos: 1
}
];

client.subscribe({
subscriptions: subscriptions,
messageId: 42
});
});
});

it("should support will message", function(done) {

async.waterfall([
Expand Down

0 comments on commit f41c4f8

Please sign in to comment.