securityos/node_modules/minimisted/test.js

17 lines
404 B
JavaScript
Raw Permalink Normal View History

2024-09-06 15:32:35 +00:00
'use strict'
const assert = require('assert')
const result = require('./')(argv => {
assert.strictEqual(argv.foo, '1')
assert.strictEqual(argv.bar, 'baz')
assert.strictEqual(argv.qux, true)
assert.deepStrictEqual(argv._, ['quux'])
return 123
}, { string: ['foo'], boolean: ['qux'] }, ['--foo', '1', '--bar', 'baz', '--qux', 'quux'])
assert.strictEqual(result, 123)
console.log('test ok!')