command.commandHelp.test.js
This file
Path
tests/command.commandHelp.test.js
19 lines · 671 bytes · JavaScript
Last changed by
Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
History of this fileTake it
The walk stopped after 200 commits: lines older than 3103c6b point at it.
Add more tests for implies (#1730)John Geebefore adoption3103c6b
line 1why, one step back1const commander = require('../');Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
lines 2–3why, one step back2const { test } = require('node:test');3const assert = require('node:assert/strict');Add more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
line 19why, one step back19});