Skip to content
Myr

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 file

Take it

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

update chinese readme (#1727)wenjiebefore adoptionb2842dc

line 1why, one step back
1const commander = require('../');

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

line 2why, one step back
2const { test, describe } = require('node:test');

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

line 3why, one step back
3const assert = require('node:assert/strict');

update chinese readme (#1727)wenjiebefore adoptionb2842dc

line 4why, one step back
4

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

lines 5–13why, one step back
5describe('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 back
14 });

update chinese readme (#1727)wenjiebefore adoptionb2842dc

line 15why, one step back
15

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

lines 16–24why, one step back
16 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 back
25 });

update chinese readme (#1727)wenjiebefore adoptionb2842dc

line 26why, one step back
26

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

lines 27–31why, one step back
27 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 back
32

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

lines 33–41why, one step back
33 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 back
42 });
43});