Skip to content

Commit

Permalink
Add missing unit test for accesses undefined environment variable fro…
Browse files Browse the repository at this point in the history
…m an expression
  • Loading branch information
dxdc committed May 28, 2020
1 parent 18f8dde commit 95cc8ea
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/@node-red/util/lib/util_spec.js
Expand Up @@ -499,6 +499,11 @@ describe("@node-red/util/util", function() {
var result = util.evaluateJSONataExpression(expr,{payload:"hello"});
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() {
process.env.UTIL_ENV = 'foo';
var expr = util.prepareJSONataExpression('$env("UTIL_ENV")',{});
Expand Down

0 comments on commit 95cc8ea

Please sign in to comment.