Skip to content

Commit

Permalink
test(halt-at-non-option): add failing scenario for when `unknown-opti…
Browse files Browse the repository at this point in the history
…ons-as-args` is also enabled
  • Loading branch information
kherock committed Jul 18, 2022
1 parent fd30238 commit 5f149be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/yargs-parser.cjs
Expand Up @@ -3008,6 +3008,16 @@ describe('yargs-parser', function () {
_: ['./file.js', '--foo', '--', 'barbar']
})
})

it('is not influenced by unknown options when "unknown-options-as-args" is true', function () {
const parse = parser(
['-v', '--long', 'arg', './file.js', '--foo', '--', 'barbar'],
{ configuration: { 'halt-at-non-option': true, 'unknown-options-as-args': true }, boolean: ['foo'] }
)
parse.should.deep.equal({
_: ['-v', '--long', 'arg', './file.js', '--foo', '--', 'barbar']
})
})
})

describe('unknown-options-as-args = true', function () {
Expand Down

0 comments on commit 5f149be

Please sign in to comment.