Skip to content

Commit

Permalink
added test for ignore case of env key prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
nw committed Jan 26, 2016
1 parent 6ec6975 commit c4d83bf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/nested-env-vars.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

var n = 'rc'+Math.random()
var seed = Math.random();
var n = 'rc'+ seed;
var N = 'RC'+ seed;
var assert = require('assert')


Expand All @@ -18,6 +20,9 @@ process.env[n+'_someOpt__w__w__'] = 18629
// Leading '__' should ignore everything up to 'z'
process.env[n+'___z__i__'] = 9999

// should ignore case for config name section.
process.env[N+'_test_upperCase'] = 187

var config = require('../')(n, {
option: true
})
Expand All @@ -37,4 +42,5 @@ assert.equal(config.someOpt.z/*.x*/, 186577)
assert.equal(config.someOpt.w.w, 18629)
assert.equal(config.z.i, 9999)

assert.equal(config.test_upperCase, 187)

0 comments on commit c4d83bf

Please sign in to comment.