Skip to content
Myr

command.nested.test.js

This file

Path

tests/command.nested.test.js

9 lines · 325 bytes · JavaScript

Last changed by

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

History of this file

Take it

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

Fix minor typo (#1579)John Geebefore adoption78e335f

lines 1–5why, one step back
1const commander = require('../');
23test('when call nested subcommand then runs', () => {4 const program = new commander.Command();5 const leafAction = jest.fn();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

line 6why, one step back
6 program.command('sub1').command('sub2').action(leafAction);

Fix minor typo (#1579)John Geebefore adoption78e335f

lines 7–9why, one step back
7 program.parse('node test.js sub1 sub2'.split(' '));
8 expect(leafAction).toHaveBeenCalled();9});