options.camelcase.test.js
This file
Path
tests/options.camelcase.test.js
49 lines · 2.0 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–6why, one step back45// Capitalise the letters of words after dashes, but otherwise preserve case6Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 7–13why, one step back7describe('option property is camelCase of option name', () => {8 test('when option defined with --word-word then option property is wordWord', () => {9 const program = new commander.Command();10 program.option('--my-option', 'description');11 program.parse(['node', 'test', '--my-option']);12 assert.equal(program.opts().myOption, true);13 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 14why, one step back14Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 15–20why, one step back15 test('when option defined with --word-wORD then option property is wordWORD', () => {16 const program = new commander.Command();17 program.option('--my-oPTION', 'description');18 program.parse(['node', 'test', '--my-oPTION']);19 assert.equal(program.opts().myOPTION, true);20 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 21why, one step back21Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 22–27why, one step back22 test('when option defined with --word-WORD then option property is wordWORD', () => {23 const program = new commander.Command();24 program.option('--my-OPTION', 'description');25 program.parse(['node', 'test', '--my-OPTION']);26 assert.equal(program.opts().myOPTION, true);27 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 28why, one step back28Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 29–34why, one step back29 test('when option defined with --word-word-word then option property is wordWordWord', () => {30 const program = new commander.Command();31 program.option('--my-special-option', 'description');32 program.parse(['node', 'test', '--my-special-option']);33 assert.equal(program.opts().mySpecialOption, true);34 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 35why, one step back35Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 36–41why, one step back36 test('when option defined with --word-WORD-word then option property is wordWORDWord', () => {37 const program = new commander.Command();38 program.option('--my-SPECIAL-option', 'description');39 program.parse(['node', 'test', '--my-SPECIAL-option']);40 assert.equal(program.opts().mySPECIALOption, true);41 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 42why, one step back42Add describe wrappers so test output makes sense without filenames (#2472)John Geebefore adoptionb3e6795
lines 43–48why, one step back43 test('when option defined with --Word then option property is Word', () => {44 const program = new commander.Command();45 program.option('--Myoption', 'description');46 program.parse(['node', 'test', '--Myoption']);47 assert.equal(program.opts().Myoption, true);48 });Add copyInheritedSettings to README (#1798)John Geebefore adoption471ec40
line 49why, one step back49});