mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Emsure trigger complete 2nd msg when set to send latest
and add test to close #2474
This commit is contained in:
@@ -736,10 +736,12 @@ describe('trigger node', function() {
|
||||
try {
|
||||
if (c === 0) {
|
||||
msg.should.have.a.property("payload", "Goodbye");
|
||||
msg.should.have.a.property("topic", "test2");
|
||||
c += 1;
|
||||
}
|
||||
else {
|
||||
msg.should.have.a.property("payload", "World");
|
||||
msg.should.have.a.property("topic", "test3");
|
||||
(Date.now() - ss).should.be.greaterThan(70);
|
||||
done();
|
||||
}
|
||||
@@ -747,12 +749,12 @@ describe('trigger node', function() {
|
||||
catch(err) { done(err); }
|
||||
});
|
||||
var ss = Date.now();
|
||||
n1.emit("input", {payload:"Hello"});
|
||||
n1.emit("input", {payload:"Hello", topic:"test1"});
|
||||
setTimeout( function() {
|
||||
n1.emit("input", {payload:"Goodbye"});
|
||||
n1.emit("input", {payload:"Goodbye", topic:"test2"});
|
||||
},20);
|
||||
setTimeout( function() {
|
||||
n1.emit("input", {payload:"World"});
|
||||
n1.emit("input", {payload:"World", topic:"test3"});
|
||||
},80);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user