Skip to content
Myr

command.createHelp.test.js

This file

Path

tests/command.createHelp.test.js

18 lines · 436 bytes · JavaScript

Last changed by

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

History of this file

Take it

Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912

lines 1–18why, one step back
1const commander = require('../');
23test('when override createCommand then affects help', () => {4 class MyHelp extends commander.Help {5 formatHelp(cmd, helper) {6 return 'custom';7 }8 }910 class MyCommand extends commander.Command {11 createHelp() {12 return Object.assign(new MyHelp(), this.configureHelp());13 };14 }1516 const program = new MyCommand();17 expect(program.helpInformation()).toEqual('custom');18});