Skip to content
Permalink
Browse files

test: add test for config object priority (#149)

  • Loading branch information...
boneskull authored and bcoe committed Nov 19, 2018
1 parent f4a3063 commit 1c5d556d12e1fb5c67e3ce057226e6c01cd5b213
Showing with 15 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +14 −0 test/yargs-parser.js
@@ -4,3 +4,4 @@ node_modules
.DS_Store
package-lock.json
./test/fixtures/package.json
coverage
@@ -747,6 +747,20 @@ describe('yargs-parser', function () {
bar: 'bar'
})
})

it('should load objects with first object having greatest priority', function () {
var argv = parser(['--foo', 'bar'], {
configObjects: [{
bar: 'baz'
}, {
bar: 'quux',
foo: 'spam'
}]
})

argv.should.have.property('foo', 'bar')
argv.should.have.property('bar', 'baz')
})
})

describe('dot notation', function () {

0 comments on commit 1c5d556

Please sign in to comment.
You can’t perform that action at this time.