Skip to content

Commit

Permalink
REFACTOR: improve readability of test to use decoded value
Browse files Browse the repository at this point in the history
  • Loading branch information
scottenock committed Oct 1, 2024
1 parent a566f3d commit 245ffe0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ test('query strings having a brackets+separator array and format option as `brac
});

test('query strings having a brackets+separator array and format option as `bracket-separator` with a URL encoded value', t => {
t.deepEqual(queryString.parse('?testA%5B%5D=1&testB%5B%5D=a%2Cb%2Cc%2Cd%2Ce%2Cf&testC=true', {
const key = 'foo[]';
const value = 'a,b,c,d,e,f'

Check failure on line 220 in test/parse.js

View workflow job for this annotation

GitHub Actions / Node.js 20

Missing semicolon.

Check failure on line 220 in test/parse.js

View workflow job for this annotation

GitHub Actions / Node.js 18

Missing semicolon.
t.deepEqual(queryString.parse(`?${encodeURIComponent(key)}=${encodeURIComponent(value)}`, {
arrayFormat: 'bracket-separator',
}), {
testA: ['1'],
testB: ['a', 'b', 'c', 'd', 'e', 'f'],
testC: 'true',
foo: ['a', 'b', 'c', 'd', 'e', 'f'],
});
});

Expand Down

0 comments on commit 245ffe0

Please sign in to comment.