From 4445e760dada3ec7db0e9d6727e4c54c1f09012a Mon Sep 17 00:00:00 2001 From: Alexander Ryzhikov Date: Sat, 5 Mar 2022 07:21:10 +0200 Subject: [PATCH] test: add more failing cases --- test/parse.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/parse.js b/test/parse.js index 5a6d9aa7..97baf79b 100644 --- a/test/parse.js +++ b/test/parse.js @@ -886,8 +886,9 @@ test('parse/stringify empty key WIP', function (t) { t.test('edge case with object/arrays', function (st) { st.deepEqual(qs.stringify({ '': { '': [2, 3] } }, { encode: false }), '[][0]=2&[][1]=3'); - - st.deepEqual(qs.parse('[][0]=2&[][1]=3', { allowEmptyKeys: true }), { '': { '': [2, 3] } }); + st.deepEqual(qs.stringify({ '': { '': [2, 3], a: 2 } }, { encode: false }), '[][0]=2&[][1]=3&[a]=2'); + st.deepEqual(qs.parse('[][0]=2&[][1]=3&[a]=2', { allowEmptyKeys: true }), { '': { '': ['2', '3'] } }); + st.deepEqual(qs.parse('[][0]=2&[][1]=3&[a]=2', { allowEmptyKeys: true }), { '': { '': ['2', '3'], a: '2' } }); st.end(); });