import { CliProgramDefinition, CliCommandDefinition, ParsedCliCommand, CliParsedCommandHandler, CliCommandHandler, CliCommandDefinitionOption } from '../src'; import { parseCommandLine, createProgram } from './helpers/utils'; describe('Command Program Definition with no commands (only global options)', () => { const globalOptions: CliCommandDefinitionOption[] = [ { name: 'opt1', valueType: 'string' }, { name: 'opt2' } ] const def = createProgram('test1', [], undefined, globalOptions); const p1 = parseCommandLine('build --opt1 opt1val', def, '1.0.0', ); it('Run Command with global handler', () => { expect(p1.options['opt1']).toEqual('opt1val'); }) })