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

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, describe } from 'node:test';3import assert from 'node:assert/strict';

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 });

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 });

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 });

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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');

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 42–43why, one step back
42 });
43});