deno.land / x / yargs@v17.6.0-deno / test / esm / helpers.mjs
1234567891011121314151617181920212223242526272829303132'use strict';
import * as assert from 'assert';import {applyExtends, hideBin, Parser} from '../../helpers/helpers.mjs';import {describe, it} from 'mocha';
describe('helpers', () => { describe('applyExtends', () => { it('exposes applyExtends helper', () => { const conf = applyExtends( {extends: './package.json', apple: 'red'}, process.cwd(), true ); assert.strictEqual(conf.name, 'yargs'); // loads packge.json. assert.strictEqual(conf.apple, 'red'); // keeps config with extends. }); }); describe('Parser', () => { it('exposes functional argument parser', () => { const argv = Parser('--foo --bar=99'); assert.strictEqual(argv.bar, 99); }); }); describe('hideBin', () => { it('hides bin for standard node.js application', () => { const args = hideBin(['node', 'foo.js', '--apple', '--banana']); assert.deepEqual(args, ['--apple', '--banana']); }); });});
Version Info