Skip to content

Commit 6a7e969

Browse files
authored
chore: add new test from upstream (#133)
1 parent aaf353e commit 6a7e969

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ test('handles short-option groups with "short" alias configured', () => {
9595
assert.deepStrictEqual(result, expected);
9696
});
9797

98+
test('handles short-option followed by its value', () => {
99+
const args = ['-fFILE'];
100+
const options = { foo: { short: 'f', type: 'string' } };
101+
const expected = { values: { __proto__: null, foo: 'FILE' }, positionals: [] };
102+
const result = parseArgs({ strict: false, args, options });
103+
assert.deepStrictEqual(result, expected);
104+
});
105+
98106
test('Everything after a bare `--` is considered a positional argument', () => {
99107
const args = ['--', 'barepositionals', 'mopositionals'];
100108
const expected = { values: { __proto__: null }, positionals: ['barepositionals', 'mopositionals'] };

0 commit comments

Comments
 (0)