change approach again
This commit is contained in:
33
node_modules/command-line-args/test/multiple.js
generated
vendored
Normal file
33
node_modules/command-line-args/test/multiple.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict'
|
||||
const TestRunner = require('test-runner')
|
||||
const commandLineArgs = require('../')
|
||||
const a = require('assert')
|
||||
|
||||
const runner = new TestRunner()
|
||||
|
||||
runner.test('multiple: string unset', function () {
|
||||
const argv = []
|
||||
const optionDefinitions = [
|
||||
{ name: 'one', multiple: true }
|
||||
]
|
||||
const result = commandLineArgs(optionDefinitions, { argv })
|
||||
a.deepStrictEqual(result, { })
|
||||
})
|
||||
|
||||
runner.test('multiple: string unset with defaultValue', function () {
|
||||
const argv = []
|
||||
const optionDefinitions = [
|
||||
{ name: 'one', multiple: true, defaultValue: 1 }
|
||||
]
|
||||
const result = commandLineArgs(optionDefinitions, { argv })
|
||||
a.deepStrictEqual(result, { one: [ 1 ]})
|
||||
})
|
||||
|
||||
runner.test('multiple: boolean unset', function () {
|
||||
const argv = []
|
||||
const optionDefinitions = [
|
||||
{ name: 'one', type: Boolean, multiple: true }
|
||||
]
|
||||
const result = commandLineArgs(optionDefinitions, { argv })
|
||||
a.deepStrictEqual(result, { })
|
||||
})
|
Reference in New Issue
Block a user