Skip to content

Commit

Permalink
test: add more failing cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Coobaha committed Mar 5, 2022
1 parent d11a8ec commit 9589c69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', { allowEmptyKeys: true }), { '': { '': ['2', '3'] } });
st.deepEqual(qs.parse('[][0]=2&[][1]=3&[a]=2', { allowEmptyKeys: true }), { '': { '': ['2', '3'], a: '2' } });

st.end();
});
Expand Down

0 comments on commit 9589c69

Please sign in to comment.