command.commandHelp.test.js
This file
Path
tests/command.commandHelp.test.js
17 lines · 590 bytes · JavaScript
Last changed by
Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
History of this fileTake it
The walk stopped after 200 commits: lines older than cc2db5b point at it.
Add optional summary for short form of subcommand description. (#1726)John Geebefore adoptioncc2db5b
lines 1–6why, one step back1const commander = require('../');23// This is a ported legacy test.45test('when program has command then appears in help', () => {6 const program = new commander.Command();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 7why, one step back7 program.command('bare');Add optional summary for short form of subcommand description. (#1726)John Geebefore adoptioncc2db5b
lines 8–13why, one step back8 const commandHelp = program.helpInformation();9 expect(commandHelp).toMatch(/Commands:\n +bare\n/);10});1112test('when program has command with optional arg then appears in help', () => {13 const program = new commander.Command();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 14why, one step back14 program.command('bare [bare-arg]');Add optional summary for short form of subcommand description. (#1726)John Geebefore adoptioncc2db5b
lines 15–17why, one step back15 const commandHelp = program.helpInformation();16 expect(commandHelp).toMatch(/Commands:\n +bare \[bare-arg\]\n/);17});