initial
This commit is contained in:
28
node_modules/command-line-args/test/internals/option-definitions.js
generated
vendored
Normal file
28
node_modules/command-line-args/test/internals/option-definitions.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict'
|
||||
const TestRunner = require('test-runner')
|
||||
const a = require('assert')
|
||||
const Definitions = require('../../lib/option-definitions')
|
||||
|
||||
const runner = new TestRunner()
|
||||
|
||||
runner.test('.get(long option)', function () {
|
||||
const definitions = Definitions.from([ { name: 'one' } ])
|
||||
a.strictEqual(definitions.get('--one').name, 'one')
|
||||
})
|
||||
|
||||
runner.test('.get(short option)', function () {
|
||||
const definitions = Definitions.from([ { name: 'one', alias: 'o' } ])
|
||||
a.strictEqual(definitions.get('-o').name, 'one')
|
||||
})
|
||||
|
||||
runner.test('.get(name)', function () {
|
||||
const definitions = Definitions.from([ { name: 'one' } ])
|
||||
a.strictEqual(definitions.get('one').name, 'one')
|
||||
})
|
||||
|
||||
runner.test('.validate()', function () {
|
||||
a.throws(function () {
|
||||
const definitions = new Definitions()
|
||||
definitions.load([ { name: 'one' }, { name: 'one' } ])
|
||||
})
|
||||
})
|
Reference in New Issue
Block a user