Skip to content
Myr

help.optionTerm.test.js

This file

Path

tests/help.optionTerm.test.js

36 lines · 1.2 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 * as commander 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–7why, one step back
4
5// These are tests of the Help class, not of the Command help.6// There is some overlap with the higher level Command tests (which predate Help).7

Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795

line 8why, one step back
8describe('Help.optionTerm()', () => {

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 9–12why, one step back
9 test('when -s flags then returns flags', () => {
10 const flags = '-s';11 const option = new commander.Option(flags);12 const helper = new commander.Help();

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

line 13why, one step back
13 assert.equal(helper.optionTerm(option), flags);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 14–19why, one step back
14 });
1516 test('when --short flags then returns flags', () => {17 const flags = '--short';18 const option = new commander.Option(flags);19 const helper = new commander.Help();

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

line 20why, one step back
20 assert.equal(helper.optionTerm(option), flags);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 21–26why, one step back
21 });
2223 test('when -s,--short flags then returns flags', () => {24 const flags = '-s,--short';25 const option = new commander.Option(flags);26 const helper = new commander.Help();

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

line 27why, one step back
27 assert.equal(helper.optionTerm(option), flags);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 28–33why, one step back
28 });
2930 test('when -s|--short flags then returns flags', () => {31 const flags = '-s|--short';32 const option = new commander.Option(flags);33 const helper = new commander.Help();

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

line 34why, one step back
34 assert.equal(helper.optionTerm(option), flags);

Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40

lines 35–36why, one step back
35 });
36});