mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add missing unit test for accesses undefined environment variable from an expression
This commit is contained in:
parent
18f8dde712
commit
95cc8ea80d
@ -499,6 +499,11 @@ describe("@node-red/util/util", function() {
|
|||||||
var result = util.evaluateJSONataExpression(expr,{payload:"hello"});
|
var result = util.evaluateJSONataExpression(expr,{payload:"hello"});
|
||||||
result.should.eql("bar");
|
result.should.eql("bar");
|
||||||
});
|
});
|
||||||
|
it('accesses undefined environment variable from an expression', function() {
|
||||||
|
var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{});
|
||||||
|
var result = util.evaluateJSONataExpression(expr,{});
|
||||||
|
result.should.eql('');
|
||||||
|
});
|
||||||
it('accesses environment variable from an expression', function() {
|
it('accesses environment variable from an expression', function() {
|
||||||
process.env.UTIL_ENV = 'foo';
|
process.env.UTIL_ENV = 'foo';
|
||||||
var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{});
|
var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{});
|
||||||
|
Loading…
Reference in New Issue
Block a user