mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
test trigger repeat for pass by ref error
This commit is contained in:
parent
6e610c0435
commit
69946f0be0
@ -526,7 +526,7 @@ describe('trigger node', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should be able to set a repeat, and clear loop by reset', function(done) {
|
it('should be able to set a repeat, and clear loop by reset', function(done) {
|
||||||
var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", reset:"boo", duration:-25, wires:[["n2"]] },
|
var flow = [{"id":"n1", "type":"trigger", "name":"triggerNode", reset:"boo", op1:"", op1type:"pay", duration:-25, wires:[["n2"]] },
|
||||||
{id:"n2", type:"helper"} ];
|
{id:"n2", type:"helper"} ];
|
||||||
helper.load(triggerNode, flow, function() {
|
helper.load(triggerNode, flow, function() {
|
||||||
var n1 = helper.getNode("n1");
|
var n1 = helper.getNode("n1");
|
||||||
@ -534,7 +534,11 @@ describe('trigger node', function() {
|
|||||||
var c = 0;
|
var c = 0;
|
||||||
n2.on("input", function(msg) {
|
n2.on("input", function(msg) {
|
||||||
c += 1;
|
c += 1;
|
||||||
msg.should.have.a.property("payload", "foo");
|
try {
|
||||||
|
msg.should.have.property('payload','foo');
|
||||||
|
msg.payload = "bar"; // try to provoke pass by reference error
|
||||||
|
}
|
||||||
|
catch(err) { done(err); }
|
||||||
});
|
});
|
||||||
n1.emit("input", {payload:"foo"}); // trigger
|
n1.emit("input", {payload:"foo"}); // trigger
|
||||||
setTimeout( function() {
|
setTimeout( function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user