Skip to content
Myr

command.commandHelp.test.js

This file

Path

tests/command.commandHelp.test.js

19 lines · 669 bytes · JavaScript

Last changed by

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

History of this file

Take it

The walk stopped after 200 commits: lines older than 471ec40 point at it.

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

lines 1–3why, one step back
1import * as commander from '../index.js';
2import { test } from 'node:test';3import assert from 'node:assert/strict';

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 4–8why, one step back
4
5// This is a ported legacy test.67test('when program has command then appears in help', () => {8 const program = new commander.Command();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 9why, one step back
9 program.command('bare');

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

line 11why, one step back
11 assert.match(commandHelp, /Commands:\n +bare\n/);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 12–15why, one step back
12});
1314test('when program has command with optional arg then appears in help', () => {15 const program = new commander.Command();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 16why, one step back
16 program.command('bare [bare-arg]');

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

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

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

line 19why, one step back
19});