Skip to content

Commit

Permalink
WIP: add test to reproduce #261
Browse files Browse the repository at this point in the history
  • Loading branch information
Mael LE GUEN committed Mar 26, 2020
1 parent b96b989 commit 40fc27b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/yargs-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,16 @@ describe('yargs-parser', function () {
result['1'][1].should.equal('b')
})

it('should support array for --foo= format when the value is dashed', function () {
var result = parser(['--option=--a', 'b'], {
array: ['option']
})

Array.isArray(result['option']).should.equal(true)
result['option'][0].should.equal('--a')
result['option'][1].should.equal('b')
})

it('should create an array when passing an argument twice with same value', function () {
var result = parser(['-x', 'val1', '-x', 'val1'])
result.should.have.property('x').that.is.an('array').and.to.deep.equal(['val1', 'val1'])
Expand Down

0 comments on commit 40fc27b

Please sign in to comment.