Skip to content
Myr

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 file

Take it

The walk stopped after 200 commits: lines older than f47bdf5 point at it.

Tidy up example now check for required command arguments (#1320)John Geebefore adoptionf47bdf5

lines 1–5why, one step back
1const commander = require('../');
23// Do some testing of the default export(s).45test('when require commander then is a Command (default export of global)', () => {

Enhance Option class to allow hiding help, specifying choices, and change how default value displayed in help (#1331)John Geebefore adoptiona05a8bc

line 6why, one step back
6 // Deprecated global command

Tidy up example now check for required command arguments (#1320)John Geebefore adoptionf47bdf5

lines 7–20why, one step back
7 const program = commander;
8 expect(program.constructor.name).toBe('Command');9});1011test('when require commander then has program (named export of global)', () => {12 // program added in v513 const program = commander.program;14 expect(program.constructor.name).toBe('Command');15});1617test('when require commander then has newable Command', () => {18 const cmd = new commander.Command();19 expect(cmd.constructor.name).toBe('Command');20});