deprecated.test.js
This file
Path
tests/deprecated.test.js
30 lines · 1.4 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 * 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–8why, one step back45// Test for backwards compatible behaviour of deprecated features that don't fit in elsewhere.6// We keep deprecated features working (when not too difficult) to avoid breaking existing code7// and reduce barriers to updating to latest version of Commander.8Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
line 9why, one step back9describe('deprecated support for option custom processing using regular expression', () => {Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 10–11why, one step back10 test('when option not given then value is default', () => {11 const program = new commander.Command();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 12why, one step back12 program.option('--cheese <type>', 'cheese type', /mild|tasty/, 'mild');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 13why, one step back13 program.parse([], { from: 'user' });Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 14why, one step back14 assert.equal(program.opts().cheese, 'mild');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 15–18why, one step back15 });1617 test('when argument matches regexp then value is as specified', () => {18 const program = new commander.Command();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 19why, one step back19 program.option('--cheese <type>', 'cheese type', /mild|tasty/, 'mild');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 20why, one step back20 program.parse(['--cheese', 'tasty'], { from: 'user' });Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 21why, one step back21 assert.equal(program.opts().cheese, 'tasty');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 22–23why, one step back22 });23Merge remote-tracking branch 'origin/develop' into release/10.xJohn Geebefore adoptione0f6173
line 24why, one step back24 test('when argument does not match regexp then value is default', () => {Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 25why, one step back25 const program = new commander.Command();Reformat code with Prettier (#2180)John Geebefore adoption1bdc749
line 26why, one step back26 program.option('--cheese <type>', 'cheese type', /mild|tasty/, 'mild');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 27why, one step back27 program.parse(['--cheese', 'other'], { from: 'user' });Switch from Jest to Node.js built-in test runner (#2463)John Geebefore adoption3dd6086
line 28why, one step back28 assert.equal(program.opts().cheese, 'mild');Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
lines 29–30why, one step back29 });30});