command.executableSubcommand.test.js
This file
Path
tests/command.executableSubcommand.test.js
19 lines · 590 bytes · JavaScript
Last changed by
Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
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 subcommand then display help', (t) => { const program = createTestCommand(); program.command('install', 'install description'); assert.throws( () => { program.parse(['node', 'test']); }, { code: 'commander.help', }, );});