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 fileTake 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 back1import * 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 back45// 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 back9 program.command('bare');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 10why, one step back10 const commandHelp = program.helpInformation();Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 11why, one step back11 assert.match(commandHelp, /Commands:\n +bare\n/);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 12–15why, one step back12});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 back16 program.command('bare [bare-arg]');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 17why, one step back17 const commandHelp = program.helpInformation();Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 18why, one step back18 assert.match(commandHelp, /Commands:\n +bare \[bare-arg\]\n/);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 19why, one step back19});