mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
better tests for windows nodes
This commit is contained in:
parent
6264104642
commit
06ffe722d4
@ -413,7 +413,7 @@ describe('trigger node', function() {
|
||||
n1.emit("input", {payload:"foo"}); // trigger
|
||||
setTimeout( function() {
|
||||
n1.emit("input", {reset:true}); // reset
|
||||
},90);
|
||||
},95);
|
||||
setTimeout( function() {
|
||||
c.should.equal(4); // should send foo 4 times.
|
||||
done();
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
var should = require("should");
|
||||
var path = require('path');
|
||||
var os = require('os');
|
||||
var fs = require('fs-extra');
|
||||
var sinon = require('sinon');
|
||||
var tailNode = require("../../../../nodes/core/storage/28-tail.js");
|
||||
@ -39,6 +40,7 @@ describe('tail Node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
if (os.type() !== "Windows_NT") {
|
||||
it('should be loaded', function(done) {
|
||||
var flow = [{id:"tailNode1", type:"tail", name: "tailNode", "split":true, "filename":fileToTail}];
|
||||
helper.load(tailNode, flow, function() {
|
||||
@ -126,6 +128,7 @@ describe('tail Node', function() {
|
||||
},1000);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
it('should throw an error if run on Windows', function(done) {
|
||||
// Stub os platform so we can make it look like windows
|
||||
|
@ -17,6 +17,7 @@
|
||||
var should = require("should");
|
||||
var path = require('path');
|
||||
var fs = require('fs-extra');
|
||||
var os = require('os');
|
||||
var sinon = require("sinon");
|
||||
var fileNode = require("../../../../nodes/core/storage/50-file.js");
|
||||
var helper = require("../../helper.js");
|
||||
@ -80,8 +81,14 @@ describe('file Nodes', function() {
|
||||
},90);
|
||||
setTimeout(function() {
|
||||
var f = fs.readFileSync(fileToTest).toString();
|
||||
if (os.type() !== "Windows_NT") {
|
||||
f.should.have.length(19);
|
||||
f.should.equal("test2\ntrue\n999\n[2]\n");
|
||||
}
|
||||
else {
|
||||
f.should.have.length(23);
|
||||
f.should.equal("test2\r\ntrue\r\n999\r\n[2]\r\n");
|
||||
}
|
||||
done();
|
||||
},wait);
|
||||
});
|
||||
@ -94,8 +101,14 @@ describe('file Nodes', function() {
|
||||
n1.emit("input", {payload:"fine", filename:fileToTest});
|
||||
setTimeout(function() {
|
||||
var f = fs.readFileSync(fileToTest).toString();
|
||||
if (os.type() !== "Windows_NT") {
|
||||
f.should.have.length(5);
|
||||
f.should.equal("fine\n");
|
||||
}
|
||||
else {
|
||||
f.should.have.length(6);
|
||||
f.should.equal("fine\r\n");
|
||||
}
|
||||
done();
|
||||
},wait);
|
||||
});
|
||||
|
@ -133,7 +133,8 @@ describe('nodes/registry/installer', function() {
|
||||
done();
|
||||
}
|
||||
else {
|
||||
err.message.should.eql("Install failed");
|
||||
console.log("ERRROR::"+err.toString()+"::");
|
||||
err.toString().should.eql("Error: Install failed");
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user