mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Merge 08fcbd46af into 2a4fb7123d
This commit is contained in:
@@ -675,7 +675,7 @@ describe('switch Node', function() {
|
||||
switchNode1.receive({payload:undefined});
|
||||
});
|
||||
});
|
||||
it('should treat non-existant msg property conditional as undefined', function(done) {
|
||||
it('should treat non-existent msg property conditional as undefined', function(done) {
|
||||
var flow = [{"id":"switchNode1","type":"switch","z":"feee1df.c3263e","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"this.does.not.exist","vt":"msg"}],"checkall":"true","outputs":1,"x":190,"y":440,"wires":[["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper", wires:[]}];
|
||||
|
||||
|
||||
@@ -898,7 +898,7 @@ describe('change Node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('changes the value and doesnt change type of the message property for partial match', function(done) {
|
||||
it('changes the value and does not change type of the message property for partial match', function(done) {
|
||||
var flow = [{"id":"changeNode1","type":"change",rules:[{ "t": "change", "p": "payload", "pt": "msg", "from": "123", "fromt": "str", "to": "456", "tot": "num" }],"reg":false,"name":"changeNode","wires":[["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper", wires:[]}];
|
||||
helper.load(changeNode, flow, function() {
|
||||
@@ -1336,7 +1336,7 @@ describe('change Node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('changes the value and doesnt change type of the flow context for partial match', function(done) {
|
||||
it('changes the value and does not change type of the flow context for partial match', function(done) {
|
||||
var flow = [{"id":"changeNode1","type":"change",rules:[{ "t": "change", "p": "payload", "pt": "flow", "from": "123", "fromt": "str", "to": "456", "tot": "num" }],"reg":false,"name":"changeNode","wires":[["helperNode1"]],"z":"flow"},
|
||||
{id:"helperNode1", type:"helper", wires:[],"z":"flow"}];
|
||||
helper.load(changeNode, flow, function() {
|
||||
@@ -1356,7 +1356,7 @@ describe('change Node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('changes the value and doesnt change type of the persistable flow context for partial match', function(done) {
|
||||
it('changes the value and does not change type of the persistable flow context for partial match', function(done) {
|
||||
var flow = [{"id":"changeNode1","type":"change",rules:[{ "t": "change", "p": "#:(memory1)::payload", "pt": "flow", "from": "123", "fromt": "str", "to": "456", "tot": "num" }],"reg":false,"name":"changeNode","wires":[["helperNode1"]],"z":"flow"},
|
||||
{id:"helperNode1", type:"helper", wires:[],"z":"flow"}];
|
||||
helper.load(changeNode, flow, function() {
|
||||
|
||||
@@ -387,7 +387,7 @@ describe('template node', function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
// mesage is intact
|
||||
// message is intact
|
||||
msg.should.have.property('topic', 'bar');
|
||||
msg.should.have.property('payload', 'foo');
|
||||
// result is in flow context
|
||||
@@ -405,7 +405,7 @@ describe('template node', function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
// mesage is intact
|
||||
// message is intact
|
||||
msg.should.have.property('topic', 'bar');
|
||||
msg.should.have.property('payload', 'foo');
|
||||
// result is in flow context
|
||||
@@ -425,7 +425,7 @@ describe('template node', function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
// mesage is intact
|
||||
// message is intact
|
||||
msg.should.have.property('topic', 'bar');
|
||||
msg.should.have.property('payload', 'foo');
|
||||
// result is in global context
|
||||
@@ -443,7 +443,7 @@ describe('template node', function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
// mesage is intact
|
||||
// message is intact
|
||||
msg.should.have.property('topic', 'bar');
|
||||
msg.should.have.property('payload', 'foo');
|
||||
// result is in global context
|
||||
|
||||
@@ -487,7 +487,7 @@ describe('rbe node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should send output if gap is 0 and input doesnt change (narrowband)', function(done) {
|
||||
it('should send output if gap is 0 and input does not change (narrowband)', function(done) {
|
||||
var flow = [{"id":"n1", "type":"rbe", func:"narrowband", gap:"0", wires:[["n2"]] },
|
||||
{id:"n2", type:"helper"} ];
|
||||
helper.load(testNode, flow, function() {
|
||||
|
||||
@@ -499,7 +499,7 @@ describe("api/editor/comms", function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
it('rejects connections for non-existant token',function(done) {
|
||||
it('rejects connections for non-existent token',function(done) {
|
||||
var ws = new WebSocket(url);
|
||||
var received = 0;
|
||||
ws.on('open', function() {
|
||||
|
||||
@@ -195,7 +195,7 @@ describe('nodes/registry/installer', function() {
|
||||
done();
|
||||
}).catch(done);
|
||||
});
|
||||
it("rejects when non-existant path is provided", function(done) {
|
||||
it("rejects when non-existent path is provided", function(done) {
|
||||
this.timeout(20000);
|
||||
var resourcesDir = path.resolve(path.join(__dirname,"resources","local","TestNodeModule","node_modules","NonExistant"));
|
||||
installer.installModule(resourcesDir).then(function() {
|
||||
|
||||
@@ -188,7 +188,7 @@ describe("red/nodes/registry/registry",function() {
|
||||
moduleList["test-module"].nodes.should.have.a.property("test-name-2");
|
||||
});
|
||||
|
||||
it('doesnt add node set types if node set has an error', function() {
|
||||
it('does not add node set types if node set has an error', function() {
|
||||
typeRegistry.init(settings,null);
|
||||
typeRegistry.getNodeList().should.have.lengthOf(0);
|
||||
typeRegistry.getModuleList().should.eql({});
|
||||
@@ -204,7 +204,7 @@ describe("red/nodes/registry/registry",function() {
|
||||
should.not.exist(typeRegistry.getTypeId("test-c"));
|
||||
});
|
||||
|
||||
it('doesnt add node set if type already exists', function() {
|
||||
it('does not add node set if type already exists', function() {
|
||||
typeRegistry.init(settings,null);
|
||||
typeRegistry.getNodeList().should.have.lengthOf(0);
|
||||
typeRegistry.getModuleList().should.eql({});
|
||||
@@ -329,7 +329,7 @@ describe("red/nodes/registry/registry",function() {
|
||||
typeRegistry.removeModule("test-module/unknown");
|
||||
}).should.throw("Unrecognised module: test-module/unknown");
|
||||
});
|
||||
it('throws error for unavaiable settings', function() {
|
||||
it('throws error for unavailable settings', function() {
|
||||
var s = stubSettings({},false,{});
|
||||
typeRegistry.init(s,null);
|
||||
/*jshint immed: false */
|
||||
|
||||
@@ -158,7 +158,7 @@ describe('red/runtime/nodes/credentials', function() {
|
||||
settings: encryptionDisabledSettings,
|
||||
nodes: { getType: () => function(){} }
|
||||
});
|
||||
var defintion = {
|
||||
var definition = {
|
||||
user1:{type:"text"},
|
||||
password1:{type:"password"},
|
||||
user2:{type:"text"},
|
||||
@@ -167,9 +167,9 @@ describe('red/runtime/nodes/credentials', function() {
|
||||
password3:{type:"password"}
|
||||
|
||||
};
|
||||
credentials.register("test",defintion);
|
||||
credentials.register("test",definition);
|
||||
var def = credentials.getDefinition("test");
|
||||
defintion.should.eql(def);
|
||||
definition.should.eql(def);
|
||||
|
||||
credentials.load({"node":{user1:"abc",password1:"123",user2:"def",password2:"456",user3:"ghi",password3:"789"}}).then(function() {
|
||||
var node = {id:"node",type:"test",credentials:{
|
||||
|
||||
@@ -37,7 +37,7 @@ describe("storage/localfilesystem/projects/ssh", function() {
|
||||
|
||||
beforeEach(function(done) {
|
||||
oldHOME = process.env.HOME;
|
||||
process.env.HOME = "/tmp/doesnt/exist";
|
||||
process.env.HOME = "/tmp/does not/exist";
|
||||
fs.remove(userDir,function(err) {
|
||||
fs.mkdir(userDir,done);
|
||||
});
|
||||
|
||||
@@ -637,12 +637,12 @@ describe("@node-red/util/util", function() {
|
||||
var result = util.evaluateJSONataExpression(expr,{});
|
||||
result.should.eql('2013-11-18T19:55:00+08:00');
|
||||
});
|
||||
it('handles non-existant flow context variable', function() {
|
||||
it('handles non-existent flow context variable', function() {
|
||||
var expr = util.prepareJSONataExpression('$flowContext("nonExistant")',{context:function() { return {flow:{get: function(key) { return {'foo':'bar'}[key]}}}}});
|
||||
var result = util.evaluateJSONataExpression(expr,{payload:"hello"});
|
||||
should.not.exist(result);
|
||||
});
|
||||
it('handles non-existant global context variable', function() {
|
||||
it('handles non-existent global context variable', function() {
|
||||
var expr = util.prepareJSONataExpression('$globalContext("nonExistant")',{context:function() { return {global:{get: function(key) { return {'foo':'bar'}[key]}}}}});
|
||||
var result = util.evaluateJSONataExpression(expr,{payload:"hello"});
|
||||
should.not.exist(result);
|
||||
|
||||
Reference in New Issue
Block a user