1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

tiny changes to JSON and exec test for node6

no need to specify npm2 defaults are ok now. (on travis)
This commit is contained in:
Dave Conway-Jones 2016-04-30 17:05:10 +01:00
parent 622d4214f7
commit b27db3e2e7
3 changed files with 9 additions and 11 deletions

View File

@ -13,8 +13,6 @@ matrix:
allow_failures: allow_failures:
- node_js: "5" - node_js: "5"
- node_js: "6" - node_js: "6"
before_install:
- npm install -g npm@latest-2
node_js: node_js:
- "6" - "6"
- "5" - "5"

View File

@ -123,7 +123,6 @@ describe('exec node', function() {
// arg3(error,stdout,stderr); // arg3(error,stdout,stderr);
arg3("error",new Buffer([0x01,0x02,0x03,0x88])); arg3("error",new Buffer([0x01,0x02,0x03,0x88]));
}); });
helper.load(execNode, flow, function() { helper.load(execNode, flow, function() {
var n1 = helper.getNode("n1"); var n1 = helper.getNode("n1");
var n2 = helper.getNode("n2"); var n2 = helper.getNode("n2");
@ -159,9 +158,10 @@ describe('exec node', function() {
var logEvents = helper.log().args.filter(function(evt) { var logEvents = helper.log().args.filter(function(evt) {
return evt[0].type == "exec"; return evt[0].type == "exec";
}); });
logEvents.should.have.length(1); var i = logEvents.length - 1;
logEvents[0][0].should.have.a.property('msg'); //logEvents.should.have.length(1);
logEvents[0][0].msg.toString().should.startWith("Exec node timeout"); logEvents[i][0].should.have.a.property('msg');
logEvents[i][0].msg.toString().should.startWith("Exec node timeout");
done(); done();
},400); },400);
n1.receive({}); n1.receive({});
@ -298,7 +298,6 @@ describe('exec node', function() {
it('should be able to timeout a long running command', function(done) { it('should be able to timeout a long running command', function(done) {
var flow = [{id:"n1",type:"exec",wires:[["n2"],["n3"],["n4"]],command:"sleep", addpay:false, append:"1", timer:"0.3", useSpawn:true}, var flow = [{id:"n1",type:"exec",wires:[["n2"],["n3"],["n4"]],command:"sleep", addpay:false, append:"1", timer:"0.3", useSpawn:true},
{id:"n2", type:"helper"},{id:"n3", type:"helper"},{id:"n4", type:"helper"}]; {id:"n2", type:"helper"},{id:"n3", type:"helper"},{id:"n4", type:"helper"}];
helper.load(execNode, flow, function() { helper.load(execNode, flow, function() {
var n1 = helper.getNode("n1"); var n1 = helper.getNode("n1");
var n2 = helper.getNode("n2"); var n2 = helper.getNode("n2");
@ -312,9 +311,9 @@ describe('exec node', function() {
var logEvents = helper.log().args.filter(function(evt) { var logEvents = helper.log().args.filter(function(evt) {
return evt[0].type == "exec"; return evt[0].type == "exec";
}); });
logEvents.should.have.length(1); var i = logEvents.length - 1;
logEvents[0][0].should.have.a.property('msg'); logEvents[i][0].should.have.a.property('msg');
logEvents[0][0].msg.toString().should.startWith("Exec node timeout"); logEvents[i][0].msg.toString().should.startWith("Exec node timeout");
done(); done();
},400); },400);
n1.receive({}); n1.receive({});

View File

@ -97,7 +97,8 @@ describe('JSON node', function() {
return evt[0].type == "json"; return evt[0].type == "json";
}); });
logEvents.should.have.length(1); logEvents.should.have.length(1);
logEvents[0][0].should.have.a.property('msg',"Unexpected token o"); logEvents[0][0].should.have.a.property('msg');
logEvents[0][0].msg.should.startWith("Unexpected token o");
logEvents[0][0].should.have.a.property('level',helper.log().ERROR); logEvents[0][0].should.have.a.property('level',helper.log().ERROR);
done(); done();
} catch(err) { } catch(err) {