Skip to content

Commit 9b6c2ae

Browse files
committed
fix test copy paste error. Add test case for when query string is "&" or "&&"
1 parent d2c6cb5 commit 9b6c2ae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sprint-2/implement/querystring.test.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test("empty query string returns {}", () => {
1212
});
1313

1414
// null or undefined
15-
test("empty query string returns {}", () => {
15+
test("null or undefined input returns {}", () => {
1616
expect(parseQueryString(null)).toEqual({});
1717
expect(parseQueryString(undefined)).toEqual({});
1818
expect(parseQueryString()).toEqual({});
@@ -81,3 +81,8 @@ test("trims whitespace from keys and values", () => {
8181
age: "30",
8282
});
8383
});
84+
85+
test("string with only delimiters returns {}", () => {
86+
expect(parseQueryString("&")).toEqual({});
87+
expect(parseQueryString("&&")).toEqual({});
88+
});

0 commit comments

Comments
 (0)