change approach again
This commit is contained in:
24
node_modules/command-line-args/test/ambiguous-input.js
generated
vendored
Normal file
24
node_modules/command-line-args/test/ambiguous-input.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
'use strict'
|
||||
const TestRunner = require('test-runner')
|
||||
const commandLineArgs = require('../')
|
||||
const a = require('assert')
|
||||
|
||||
const runner = new TestRunner()
|
||||
|
||||
runner.test('ambiguous input: value looks like option', function () {
|
||||
const optionDefinitions = [
|
||||
{ name: 'colour', type: String, alias: 'c' }
|
||||
]
|
||||
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '-c', 'red' ] }), {
|
||||
colour: 'red'
|
||||
})
|
||||
a.throws(function () {
|
||||
commandLineArgs(optionDefinitions, { argv: [ '--colour', '--red' ] })
|
||||
})
|
||||
a.doesNotThrow(function () {
|
||||
commandLineArgs(optionDefinitions, { argv: [ '--colour=--red' ] })
|
||||
})
|
||||
a.deepStrictEqual(commandLineArgs(optionDefinitions, { argv: [ '--colour=--red' ] }), {
|
||||
colour: '--red'
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user