MCPcopy
hub / github.com/tj/commander.js / createPepperProgramWithDefaultAndPreset

Function createPepperProgramWithDefaultAndPreset

tests/options.bool.combo.test.js:125–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

123
124 describe('option with non-boolean default and preset', () => {
125 function createPepperProgramWithDefaultAndPreset() {
126 const program = new commander.Command();
127 program
128 .addOption(
129 new commander.Option('-p, --pepper')
130 .default('default')
131 .preset('preset'),
132 )
133 .option('-P, --no-pepper', 'remove pepper');
134 return program;
135 }
136
137 test('when option not specified then value is default', () => {
138 const program = createPepperProgramWithDefaultAndPreset();

Callers 1

Calls 4

addOptionMethod · 0.95
optionMethod · 0.80
presetMethod · 0.80
defaultMethod · 0.45

Tested by

no test coverage detected