command.createHelp.test.js
This file
Path
tests/command.createHelp.test.js
18 lines · 435 bytes · JavaScript
Last changed by
Merge pull request #1683 from tj/release/9.xJohn Geebefore adoption02a124c
History of this fileTake it
12345678910111213141516171819const commander = require('../');
test('when override createCommand then affects help', () => { class MyHelp extends commander.Help { formatHelp(cmd, helper) { return 'custom'; } }
class MyCommand extends commander.Command { createHelp() { return Object.assign(new MyHelp(), this.configureHelp()); } }
const program = new MyCommand(); expect(program.helpInformation()).toEqual('custom');});