Skip to content
Myr

command.configureHelp.test.js

This file

Path

tests/command.configureHelp.test.js

39 lines · 1.2 KiB · JavaScript

Last changed by

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

History of this file

Take it

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

Change .action() JSDoc/TSDoc example (#1614)John Geebefore adoption36c2f68

lines 1–4why, one step back
1const commander = require('../');
23test('when configure program then affects program helpInformation', () => {4 const program = new commander.Command();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

lines 5–9why, one step back
5 program.configureHelp({
6 formatHelp: () => {7 return 'custom';8 },9 });

Change .action() JSDoc/TSDoc example (#1614)John Geebefore adoption36c2f68

lines 10–14why, one step back
10 expect(program.helpInformation()).toEqual('custom');
11});1213test('when configure program then affects subcommand helpInformation', () => {14 const program = new commander.Command();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

lines 15–19why, one step back
15 program.configureHelp({
16 formatHelp: () => {17 return 'custom';18 },19 });

Change .action() JSDoc/TSDoc example (#1614)John Geebefore adoption36c2f68

lines 20–35why, one step back
20 const sub = program.command('sub');
21 expect(sub.helpInformation()).toEqual('custom');22});2324test('when configure with unknown property then createHelp has unknown property', () => {25 const program = new commander.Command();26 program.configureHelp({ mySecretValue: 'secret' });27 expect(program.createHelp().mySecretValue).toEqual('secret');28});2930test('when configure with unknown property then helper passed to formatHelp has unknown property', () => {31 const program = new commander.Command();32 program.configureHelp({33 mySecretValue: 'secret',34 formatHelp: (cmd, helper) => {35 return helper.mySecretValue;

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 36why, one step back
36 },

Change .action() JSDoc/TSDoc example (#1614)John Geebefore adoption36c2f68

lines 37–39why, one step back
37 });
38 expect(program.helpInformation()).toEqual('secret');39});