From 69946f0be0074c983d402e5f67b9be62f98f0926 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Wed, 20 Sep 2017 08:42:23 +0100 Subject: [PATCH] test trigger repeat for pass by ref error --- test/nodes/core/core/89-trigger_spec.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/nodes/core/core/89-trigger_spec.js b/test/nodes/core/core/89-trigger_spec.js index 64bdc1fd1..7a30f4917 100644 --- a/test/nodes/core/core/89-trigger_spec.js +++ b/test/nodes/core/core/89-trigger_spec.js @@ -526,7 +526,7 @@ describe('trigger node', function() { }); 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"} ]; helper.load(triggerNode, flow, function() { var n1 = helper.getNode("n1"); @@ -534,7 +534,11 @@ describe('trigger node', function() { var c = 0; n2.on("input", function(msg) { 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 setTimeout( function() {