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 fileTake 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 back1import * 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 back4Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 5why, one step back5test('when call nested subcommand then runs', (t) => {Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 6why, one step back6 const program = new commander.Command();Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 7why, one step back7 const leafAction = t.mock.fn();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 8why, one step back8 program.command('sub1').command('sub2').action(leafAction);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 9why, one step back9 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 back10 assert.equal(leafAction.mock.callCount(), 1);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 11why, one step back11});