(function(){var e,n;e=require("../"),n=require("detect-node"),describe("Queue test suite",function(){var t;return t=function(){return n?new e.Queue("guest","guest","192.168.1.100",61613):new e.Queue("guest","guest","localhost",15674)},it("should construct an instance",function(){var e;return e=t(),expect(e).not.toBeNull()}),it("should be able to connect and disconnect",function(e){var n;return n=t(),expect(n).not.toBeNull(),n.on("connected",function(){return expect(n.state()).toBe("connected"),n.disconnect(),e()}),n.connect()}),describe("Queue functionality test suite",function(){var e,n;return e=null,n=function(){},beforeEach(function(){return e=t()}),afterEach(function(){return e=null}),it("should be able to subscribe",function(t){return e.on("connected",function(){return e.subscribe("test",n),expect(e.channels.test).not.toBeNull(),e.disconnect()}),e.on("disconnected",function(){return t()}),e.connect()}),it("should be able to unsubscribe",function(t){return e.on("connected",function(){return e.subscribe("test",n),expect(e.channels.test).not.toBeNull(),e.unsubscribe("test",n),expect(e.channels.test).toBeNull(),e.disconnect()}),e.on("disconnected",function(){return t()}),e.connect()}),it("should be able to publish",function(n){var t;return t=function(n){return e.unsubscribe("test",t),expect(e.channels.test).toBeNull(),e.disconnect()},e.on("connected",function(){return e.subscribe("test",t),expect(e.channels.test).not.toBeNull(),e.publish("test",{hello:"world"})}),e.on("disconnected",function(){return n()}),e.connect()})})})}).call(this);