command.configureHelp.test.js
This file
Path
tests/command.configureHelp.test.js
43 lines · 1.4 KiB · JavaScript
Last changed by
Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
History of this fileTake it
The walk stopped after 200 commits: lines older than b2842dc point at it.
update chinese readme (#1727)wenjiebefore adoptionb2842dc
line 1why, one step back1const commander = require('../');Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
line 2why, one step back2const { test, describe } = require('node:test');Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 3why, one step back3const assert = require('node:assert/strict');update chinese readme (#1727)wenjiebefore adoptionb2842dc
line 4why, one step back4Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 5–13why, one step back5describe('Command.configureHelp()', () => {6 test('when configure program then affects program helpInformation', () => {7 const program = new commander.Command();8 program.configureHelp({9 formatHelp: () => {10 return 'custom';11 },12 });13 assert.equal(program.helpInformation(), 'custom');Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 14why, one step back14 });update chinese readme (#1727)wenjiebefore adoptionb2842dc
line 15why, one step back15Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 16–24why, one step back16 test('when configure program then affects subcommand helpInformation', () => {17 const program = new commander.Command();18 program.configureHelp({19 formatHelp: () => {20 return 'custom';21 },22 });23 const sub = program.command('sub');24 assert.equal(sub.helpInformation(), 'custom');Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 25why, one step back25 });update chinese readme (#1727)wenjiebefore adoptionb2842dc
line 26why, one step back26Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 27–31why, one step back27 test('when configure with unknown property then createHelp has unknown property', () => {28 const program = new commander.Command();29 program.configureHelp({ mySecretValue: 'secret' });30 assert.equal(program.createHelp().mySecretValue, 'secret');31 });update chinese readme (#1727)wenjiebefore adoptionb2842dc
line 32why, one step back32Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 33–41why, one step back33 test('when configure with unknown property then helper passed to formatHelp has unknown property', () => {34 const program = new commander.Command();35 program.configureHelp({36 mySecretValue: 'secret',37 formatHelp: (cmd, helper) => {38 return helper.mySecretValue;39 },40 });41 assert.equal(program.helpInformation(), 'secret');update chinese readme (#1727)wenjiebefore adoptionb2842dc
lines 42–43why, one step back42 });43});