Skip to content

Commit

Permalink
Add test for enclosed parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
nVitius committed Jan 21, 2021
1 parent 1a716a9 commit d6f3d97
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ describe('dotenv-expand', function () {
done()
})

it('expands variables inside of curly braces', function (done) {
var dotenv = {
parsed: {
'PORT': '12345',
'ENCLOSED': '{port: $PORT}',
'ENCLOSED_SIMPLE': '{port: $PORT}'
}
}
var obj = dotenvExpand(dotenv).parsed

obj['ENCLOSED'].should.eql('{port: 12345}')
obj['ENCLOSED_SIMPLE'].should.eql('{port: 12345}')
done()
})

it('expands environment variables existing already on the machine', function (done) {
process.env.MACHINE = 'machine'
var dotenv = {
Expand Down

0 comments on commit d6f3d97

Please sign in to comment.