command.executableSubcommand.test.js
This file
Path
tests/command.executableSubcommand.test.js
19 lines · 579 bytes · JavaScript
Last changed by
Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
History of this fileTake it
1234567891011121314151617181920const { createTestCommand } = require('./testHelpers');const { test } = require('node:test');const assert = require('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 then display help', (t) => { const program = createTestCommand(); program.command('install', 'install description'); assert.throws( () => { program.parse(['node', 'test']); }, { code: 'commander.help', }, );});