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

Commit

Permalink
Fixed another spurious failing test.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Feb 18, 2014
1 parent 4838a09 commit 797e3e5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions test/abstract_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,28 +1040,17 @@ module.exports = function(moscaSettings, createConnection) {
});

it("should pass mosca options to backend when publishing", function(done) {
instance.authenticate = function(client, username, password, callback) {
expect(username).to.be.eql("matteo");
expect(password).to.be.eql("collina");
client.user = username;
callback(null, true);
};

buildClient(done, function(client) {

var messageId = Math.floor(65535 * Math.random());

instance.ascoltatore.subscribe("hello", function (topic, message, options) {
expect(options.mosca.packet).to.have.property("messageId", messageId);
expect(options.mosca.client).to.have.property("user", "matteo");
expect(options.mosca.packet).to.have.property("qos", 1);
client.disconnect();
});

var options = buildOpts();
options.username = "matteo";
options.password = "collina";

client.connect(options);
client.connect(buildOpts());

client.on('connack', function(packet) {
expect(packet.returnCode).to.eql(0);
Expand Down

0 comments on commit 797e3e5

Please sign in to comment.