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 fileTake 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 back1const commander = require('../');Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
lines 2–3why, one step back2const { test } = require('node:test');3const assert = require('node:assert/strict');Add more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
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 more tests for implies (#1730)John Geebefore adoption3103c6b
line 11why, one step back11});