Skip to content

Commit

Permalink
[Tests] add a test case for dotted notation
Browse files Browse the repository at this point in the history
(from #66)
  • Loading branch information
git-developer authored and ljharb committed Jun 12, 2024
1 parent 1ea83d8 commit bedaa8b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/dotted.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ test('dotted default with no alias', function (t) {
t.equal(argv.a.b, 11);
t.end();
});

test('dotted array', function (t) {
var argv = parse(['--a.1.foo', '11']);

t.notOk(Array.isArray(argv.a));

t.notOk(0 in argv.a);

t.equal(argv.a[1].foo, 11);

t.end();
});

0 comments on commit bedaa8b

Please sign in to comment.