Skip to content
Myr

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 file

Take it

Add program to exports (#1195)John Geebefore adoption0a50bd6

lines 1–20why, 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)', () => {6 // Legacy global command7 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});