command.nested.test.js
This file
Path
tests/command.nested.test.js
12 lines · 340 bytes · JavaScript
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than 20cef03 point at it.
Update supported details for 7.x (#1419)John Geebefore adoption20cef03
lines 1–12why, one step back1const commander = require('../');23test('when call nested subcommand then runs', () => {4 const program = new commander.Command();5 const leafAction = jest.fn();6 program7 .command('sub1')8 .command('sub2')9 .action(leafAction);10 program.parse('node test.js sub1 sub2'.split(' '));11 expect(leafAction).toHaveBeenCalled();12});