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

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

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.

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

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', () => {

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

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();

Parse rework for nested commands (#1149)John Geebefore adoption1345f98

line 10why, one step back
10 expect(commandHelp).toMatch(/Commands:\n +bare\n/);

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

lines 11–12why, one step back
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', () => {

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

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();

Parse rework for nested commands (#1149)John Geebefore adoption1345f98

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

Move to Jest as testing framework (#1035)John Geebefore adoptiond7f9cd4

line 19why, one step back
19});