mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Extra tests for html, xml, json and tail nodes
(and some consistent passing of missing payloads)
This commit is contained in:
@@ -149,7 +149,25 @@ describe('html node', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
it('should pass through if payload empty', function(done) {
|
||||
fs.readFile(file, 'utf8', function(err, data) {
|
||||
var flow = [{id:"n1",type:"html",wires:[["n2"]],func:"return msg;"},
|
||||
{id:"n2", type:"helper"}];
|
||||
|
||||
helper.load(htmlNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
msg.should.have.property('topic', 'bar');
|
||||
msg.should.not.have.property('payload');
|
||||
done();
|
||||
});
|
||||
n1.receive({topic: "bar"});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('multiple messages', function(){
|
||||
var cnt = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user