option.chain.test.js
This file
Path
tests/option.chain.test.js
53 lines · 1.7 KiB · 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 { Option } from '../index.js';2import { test, describe } from 'node:test';3import assert from 'node:assert/strict';Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 4–8why, one step back45describe('Option methods that should return this for chaining', () => {6 test('when call .default() then returns this', () => {7 const option = new Option('-e,--example <value>');8 const result = option.default(3);Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 9why, one step back9 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 10–13why, one step back10 });1112 test('when call .argParser() then returns this', () => {13 const option = new Option('-e,--example <value>');Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 14why, one step back14 const result = option.argParser(() => {});Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 15why, one step back15 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 16–20why, one step back16 });1718 test('when call .makeOptionMandatory() then returns this', () => {19 const option = new Option('-e,--example <value>');20 const result = option.makeOptionMandatory();Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 21why, one step back21 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 22–26why, one step back22 });2324 test('when call .hideHelp() then returns this', () => {25 const option = new Option('-e,--example <value>');26 const result = option.hideHelp();Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 27why, one step back27 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 28–32why, one step back28 });2930 test('when call .choices() then returns this', () => {31 const option = new Option('-e,--example <value>');32 const result = option.choices(['a']);Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 33why, one step back33 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 34–38why, one step back34 });3536 test('when call .env() then returns this', () => {37 const option = new Option('-e,--example <value>');38 const result = option.env('e');Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 39why, one step back39 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 40–44why, one step back40 });4142 test('when call .conflicts() then returns this', () => {43 const option = new Option('-e,--example <value>');44 const result = option.conflicts(['a']);Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 45why, one step back45 assert.equal(result, option);Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 46why, one step back46 });Add support for groups of options and commands in the help (#2328)John Geebefore adoptionc324ea3
lines 47–50why, one step back4748 test('when call .helpGroup(heading) then returns this', () => {49 const option = new Option('-e,--example <value>');50 const result = option.helpGroup('Options:');Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 51why, one step back51 assert.equal(result, option);Add support for groups of options and commands in the help (#2328)John Geebefore adoptionc324ea3
line 52why, one step back52 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 53why, one step back53});