help.commandDescription.test.js
This file
Path
tests/help.commandDescription.test.js
20 lines · 764 bytes · JavaScript
Last changed by
Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
History of this fileTake it
Refactor help internals into separate interface/class (#1365)John Geebefore adoption19ae912
lines 1–20why, one step back1const commander = require('../');23// These are tests of the Help class, not of the Command help.4// There is some overlap with the higher level Command tests (which predate Help).56describe('subcommandDescription', () => {7 test('when program has no description then empty string', () => {8 const program = new commander.Command();9 const helper = new commander.Help();10 expect(helper.subcommandDescription(program)).toEqual('');11 });1213 test('when program has description then return description', () => {14 const description = 'description';15 const program = new commander.Command();16 program.description(description);17 const helper = new commander.Help();18 expect(helper.subcommandDescription(program)).toEqual(description);19 });20});