program.test.js
This file
Path
tests/program.test.js
20 lines · 637 bytes · JavaScript
Last changed by
Enhance Option class to allow hiding help, specifying choices, and change how default value displayed in help (#1331)John Geebefore adoptiona05a8bc
History of this fileTake it
123456789101112131415161718192021const commander = require('../');
// Do some testing of the default export(s).
test('when require commander then is a Command (default export of global)', () => { // Deprecated global command const program = commander; expect(program.constructor.name).toBe('Command');});
test('when require commander then has program (named export of global)', () => { // program added in v5 const program = commander.program; expect(program.constructor.name).toBe('Command');});
test('when require commander then has newable Command', () => { const cmd = new commander.Command(); expect(cmd.constructor.name).toBe('Command');});