Skip to content
Myr

command.createHelp.test.js

This file

Path

tests/command.createHelp.test.js

20 lines · 518 bytes · JavaScript

Last changed by

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

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('../');

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

lines 2–3why, one step back
2const { test } = require('node:test');
3const assert = require('node:assert/strict');

update chinese readme (#1727)wenjiebefore adoptionb2842dc

lines 4–18why, one step back
4
5test('when override createCommand then affects help', () => {6 class MyHelp extends commander.Help {7 formatHelp(cmd, helper) {8 return 'custom';9 }10 }1112 class MyCommand extends commander.Command {13 createHelp() {14 return Object.assign(new MyHelp(), this.configureHelp());15 }16 }1718 const program = new MyCommand();

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

line 19why, one step back
19 assert.equal(program.helpInformation(), 'custom');

update chinese readme (#1727)wenjiebefore adoptionb2842dc

line 20why, one step back
20});