Skip to content
Myr

command.nested.test.js

This file

Path

tests/command.nested.test.js

11 lines · 420 bytes · JavaScript

Last changed by

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

History of this file

Take it

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

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 1why, one step back
1const commander = require('../');

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

lines 2–3why, one step back
2const { test } = require('node:test');
3const assert = require('node:assert/strict');

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 4why, one step back
4

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

line 5why, one step back
5test('when call nested subcommand then runs', (t) => {

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 6why, one step back
6 const program = new commander.Command();

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

line 7why, one step back
7 const leafAction = t.mock.fn();

Reformat code with Prettier (#2180)John Geebefore adoption1bdc749

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

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 9why, one step back
9 program.parse('node test.js sub1 sub2'.split(' '));

Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086

line 10why, one step back
10 assert.equal(leafAction.mock.callCount(), 1);

Add more tests for implies (#1730)John Geebefore adoption3103c6b

line 11why, one step back
11});