Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than 08ec04e point at it.

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

lines 1–2why, one step back
1const commander = require('../');
2

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

line 3why, one step back
3// This is a ported legacy test.

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

line 4why, one step back
4

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

line 5why, one step back
5test('when program has command then appears in help', () => {

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

lines 6–8why, one step back
6 const program = new commander.Command();
7 program8 .command('bare');

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

line 9why, one step back
9 const commandHelp = program.helpInformation();

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

lines 10–12why, one step back
10 expect(commandHelp).toMatch(/Commands:\n +bare\n/);
11});12

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

line 13why, one step back
13test('when program has command with optional arg then appears in help', () => {

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

lines 14–16why, one step back
14 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 back
17 const commandHelp = program.helpInformation();

Type commands property (#1184)Dmitrii Maganovbefore adoption08ec04e

lines 18–19why, one step back
18 expect(commandHelp).toMatch(/Commands:\n +bare \[bare-arg\]\n/);
19});