Skip to content

Commit

Permalink
test: adds missing array choice regression test (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden authored and bcoe committed Oct 27, 2019
1 parent 2ba8ce0 commit 5120aec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/yargs.js
Expand Up @@ -110,6 +110,18 @@ describe('yargs dsl tests', () => {
argv.looks.should.eql('good')
})

it('should ignore a missing array choice with an empty default', () => {
const argv = yargs(['--looks', '--looks', 'good'])
.option('looks', {
type: 'array',
default: [],
choices: ['good', 'bad']
})
.parse()

argv.looks.should.deep.eql(['good'])
})

it('should allow defaultDescription to be set with .option()', () => {
const optDefaultDescriptions = yargs([])
.option('port', {
Expand Down

0 comments on commit 5120aec

Please sign in to comment.