command.commandHelp.test.js
This file
Path
tests/command.commandHelp.test.js
19 lines · 600 bytes · JavaScript
Last changed by
Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
History of this fileTake it
Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
lines 1–2why, one step back1const commander = require('../');2Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
line 3why, one step back3// This is a ported legacy test.Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
line 4why, one step back4Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
line 5why, one step back5test('when program has command then appears in help', () => {Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
lines 6–8why, one step back6 const program = new commander.Command();7 program8 .command('bare');Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
line 9why, one step back9 const commandHelp = program.helpInformation();Parse rework for nested commands (#1149)John Geebefore adoption1345f98
line 10why, one step back10 expect(commandHelp).toMatch(/Commands:\n +bare\n/);Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
lines 11–12why, one step back11});12Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
line 13why, one step back13test('when program has command with optional arg then appears in help', () => {Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
lines 14–16why, one step back14 const program = new commander.Command();15 program16 .command('bare [bare-arg]');Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
line 17why, one step back17 const commandHelp = program.helpInformation();Parse rework for nested commands (#1149)John Geebefore adoption1345f98
line 18why, one step back18 expect(commandHelp).toMatch(/Commands:\n +bare \[bare-arg\]\n/);Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4
line 19why, one step back19});