Skip to content

Commit

Permalink
test: add test for config object priority (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull authored and bcoe committed Nov 19, 2018
1 parent f4a3063 commit 1c5d556
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
.DS_Store
package-lock.json
./test/fixtures/package.json
coverage
14 changes: 14 additions & 0 deletions test/yargs-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 1c5d556

Please sign in to comment.