command.executableSubcommand.test.js
This file
Path
tests/command.executableSubcommand.test.js
19 lines · 578 bytes · JavaScript
Last changed by
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
History of this fileTake it
1234567891011121314151617181920import { createTestCommand } from './testHelpers.js';import { test } from 'node:test';import assert from 'node:assert/strict';
// Executable subcommand tests that didn't fit in elsewhere.
// This is the default behaviour when no default command and no action handlerstest('when no command specified and executable subcommand then display help', (t) => { const program = createTestCommand(); program.command('install', 'install description'); assert.throws( () => { program.parse(['node', 'test']); }, { code: 'commander.help', }, );});