From bedaa8b9ab5a901fa342aad4494cbbf676b11a21 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 12 Jun 2024 18:20:19 +0200 Subject: [PATCH] [Tests] add a test case for dotted notation (from #66) --- test/dotted.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/dotted.js b/test/dotted.js index 126ff03..c606118 100644 --- a/test/dotted.js +++ b/test/dotted.js @@ -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(); +});