mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Let credentials also use $(...) substitutions from ENV
to close #1051 (and add to test)
This commit is contained in:
@@ -38,8 +38,9 @@ describe("red/nodes/index", function() {
|
||||
index.clearRegistry();
|
||||
});
|
||||
|
||||
process.env.foo="bar";
|
||||
var testFlows = [{"type":"test","id":"tab1","label":"Sheet 1"}];
|
||||
var testCredentials = {"tab1":{"b":1,"c":2}};
|
||||
var testCredentials = {"tab1":{"b":1, "c":"2", "d":"$(foo)"}};
|
||||
var storage = {
|
||||
getFlows: function() {
|
||||
return when({red:123,flows:testFlows,credentials:testCredentials});
|
||||
@@ -58,7 +59,7 @@ describe("red/nodes/index", function() {
|
||||
var runtime = {
|
||||
settings: settings,
|
||||
storage: storage,
|
||||
log: {debug:function(){},warn:function(){}}
|
||||
log: {debug:function() {}, warn:function() {}}
|
||||
};
|
||||
|
||||
function TestNode(n) {
|
||||
@@ -75,7 +76,8 @@ describe("red/nodes/index", function() {
|
||||
index.loadFlows().then(function() {
|
||||
var testnode = new TestNode({id:'tab1',type:'test',name:'barney'});
|
||||
testnode.credentials.should.have.property('b',1);
|
||||
testnode.credentials.should.have.property('c',2);
|
||||
testnode.credentials.should.have.property('c',"2");
|
||||
testnode.credentials.should.have.property('d',"bar");
|
||||
done();
|
||||
}).otherwise(function(err) {
|
||||
done(err);
|
||||
|
Reference in New Issue
Block a user