enhance a couple of tests to check more

Delay node checks  times properly for both types of queue. And File
checks to make sure other payload types are handled (a bit better than
they were)
This commit is contained in:
Dave Conway-Jones
2016-04-24 17:41:22 +01:00
parent 8fc0018cb9
commit b2923d0fc4
2 changed files with 72 additions and 67 deletions

View File

@@ -71,13 +71,17 @@ describe('file Nodes', function() {
n1.emit("input", {payload:"test2"}); // string
setTimeout(function() {
n1.emit("input", {payload:true}); // boolean
n1.emit("input", {payload:1});
n1.emit("input", {payload:[2]});
},50);
},30);
setTimeout(function() {
n1.emit("input", {payload:999}); // number
},60);
setTimeout(function() {
n1.emit("input", {payload:[2]}); // object (array)
},90);
setTimeout(function() {
var f = fs.readFileSync(fileToTest).toString();
f.should.have.length(17);
f.should.equal("test2\ntrue\n1\n[2]\n");
f.should.have.length(19);
f.should.equal("test2\ntrue\n999\n[2]\n");
done();
},wait);
});