Skip to content
Myr

command.nested.test.js

This file

Path

tests/command.nested.test.js

11 lines · 418 bytes · JavaScript

Last changed by

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

History of this file

Take it

The walk stopped after 200 commits: lines older than 471ec40 point at it.

Switching to esm-only (#2464)John Geebefore adoptionf4bd470

lines 1–3why, one step back
1import * as commander from '../index.js';
2import { test } from 'node:test';3import assert from 'node:assert/strict';

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

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 copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

line 11why, one step back
11});