Skip to content

Commit 67c9180

Browse files
authored
Comment out new misuse check until a major version (#2026)
1 parent 96c6c25 commit 67c9180

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

lib/command.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
751751
if (this.options.length) {
752752
throw new Error('call .storeOptionsAsProperties() before adding options');
753753
}
754-
if (Object.keys(this._optionValues).length) {
755-
throw new Error('call .storeOptionsAsProperties() before setting option values');
756-
}
754+
// if (Object.keys(this._optionValues).length) {
755+
// throw new Error('call .storeOptionsAsProperties() before setting option values');
756+
// }
757757
this._storeOptionsAsProperties = !!storeAsProperties;
758758
return this;
759759
}

tests/commander.configureCommand.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ test('when storeOptionsAsProperties() after adding option then throw', () => {
8585
}).toThrow();
8686
});
8787

88-
test('when storeOptionsAsProperties() after setting option value then throw', () => {
89-
const program = new commander.Command();
90-
program.setOptionValue('foo', 'bar');
91-
expect(() => {
92-
program.storeOptionsAsProperties();
93-
}).toThrow();
94-
});
88+
// test('when storeOptionsAsProperties() after setting option value then throw', () => {
89+
// const program = new commander.Command();
90+
// program.setOptionValue('foo', 'bar');
91+
// expect(() => {
92+
// program.storeOptionsAsProperties();
93+
// }).toThrow();
94+
// });

0 commit comments

Comments
 (0)