mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Move comms from runtime to api component
This commit is contained in:
@@ -19,7 +19,6 @@ var sinon = require('sinon');
|
||||
var RedNode = require("../../../../red/runtime/nodes/Node");
|
||||
var Log = require("../../../../red/runtime/log");
|
||||
var flows = require("../../../../red/runtime/nodes/flows");
|
||||
var comms = require("../../../../red/runtime/comms");
|
||||
|
||||
describe('Node', function() {
|
||||
describe('#constructor',function() {
|
||||
@@ -512,9 +511,6 @@ describe('Node', function() {
|
||||
});
|
||||
|
||||
describe('#status', function() {
|
||||
after(function() {
|
||||
comms.publish.restore();
|
||||
});
|
||||
it('publishes status', function(done) {
|
||||
sinon.stub(flows,"handleStatus", function(node,message,msg) {});
|
||||
var n = new RedNode({id:'123',type:'abc'});
|
||||
@@ -522,18 +518,9 @@ describe('Node', function() {
|
||||
var topic;
|
||||
var message;
|
||||
var retain;
|
||||
sinon.stub(comms, 'publish', function(_topic, _message, _retain) {
|
||||
topic = _topic;
|
||||
message = _message;
|
||||
retain = _retain;
|
||||
});
|
||||
|
||||
n.status(status);
|
||||
|
||||
topic.should.equal('status/123');
|
||||
message.should.equal(status);
|
||||
retain.should.be.true;
|
||||
|
||||
flows.handleStatus.called.should.be.true;
|
||||
flows.handleStatus.args[0][0].should.eql(n);
|
||||
flows.handleStatus.args[0][1].should.eql(status);
|
||||
|
Reference in New Issue
Block a user