Skip to content
Myr

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 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 { 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 back
4
5describe('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 back
9 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 10–13why, one step back
10 });
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 back
14 const result = option.argParser(() => {});

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

line 15why, one step back
15 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 16–20why, one step back
16 });
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 back
21 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 22–26why, one step back
22 });
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 back
27 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 28–32why, one step back
28 });
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 back
33 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 34–38why, one step back
34 });
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 back
39 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 40–44why, one step back
40 });
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 back
45 assert.equal(result, option);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

line 46why, one step back
46 });

Add support for groups of options and commands in the help (#2328)John Geebefore adoptionc324ea3

lines 47–50why, one step back
47
48 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 back
51 assert.equal(result, option);

Add support for groups of options and commands in the help (#2328)John Geebefore adoptionc324ea3

line 52why, one step back
52 });

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

line 53why, one step back
53});