command.createHelp.test.js
This file
Path
tests/command.createHelp.test.js
22 lines · 620 bytes · JavaScript
Last changed by
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
History of this fileTake 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 back1import * 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 back4Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 5–10why, one step back5describe('Command.createHelp() override in subclass', () => {6 test('when override createCommand then affects help', () => {7 class MyHelp extends commander.Help {8 formatHelp(cmd, helper) {9 return 'custom';10 }Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 11–12why, one step back11 }12Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 13–16why, one step back13 class MyCommand extends commander.Command {14 createHelp() {15 return Object.assign(new MyHelp(), this.configureHelp());16 }Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 17–18why, one step back17 }18Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 19–21why, one step back19 const program = new MyCommand();20 assert.equal(program.helpInformation(), 'custom');21 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 22why, one step back22});