program.test.js
This file
Path
tests/program.test.js
20 lines · 633 bytes · JavaScript
Last changed by
Add program to exports (#1195)John Geebefore adoption0a50bd6
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)', () => { // Legacy 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');});