Skip to content

Commit f5e4440

Browse files
committed
chore(options): drop the shadowed array declaration of config
commonOptions declared config as Array, but the dictionary is built with globalOptions extending over commonOptions, so the String declaration (alias -c) always won and the Array entry was unreachable. The test exercising the array-length check now declares its own array option instead of leaning on the shadowed entry.
1 parent 353ec6b commit f5e4440

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

lib/options.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ export class Options {
172172
},
173173
json: { type: OptionType.Boolean, hasSensitiveValue: false },
174174
avd: { type: OptionType.String, hasSensitiveValue: true },
175-
// check not used
176-
config: { type: OptionType.Array, hasSensitiveValue: false },
177175
insecure: {
178176
type: OptionType.Boolean,
179177
alias: "k",

test/options.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ describe("options", () => {
243243
});
244244

245245
it("breaks execution when valid array option has value with length 0", () => {
246-
process.argv.push("--config");
246+
process.argv.push("--test1");
247247
const options = createOptions(testInjector);
248-
options.validateOptions();
248+
options.validateOptions({
249+
test1: { type: OptionType.Array, hasSensitiveValue: false },
250+
});
249251
process.argv.pop();
250252
assert.isTrue(isExecutionStopped);
251253
});

0 commit comments

Comments
 (0)