Skip to content

Commit 9ac03ab

Browse files
committed
Add test
1 parent 3ff477e commit 9ac03ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/node/wretch.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,9 +708,10 @@ describe("Wretch", function () {
708708
expect(w.query({ a: 1 }).query({}, true)._url).toBe(_URL)
709709
})
710710

711-
it("should strip undefined values", function () {
711+
it("should strip or omit undefined/null values", function () {
712712
const w = wretch(_URL).addon(QueryStringAddon)
713713
expect(w.query({ a: undefined, b: 1 })._url).toBe(_URL + "?a=&b=1")
714+
expect(w.query({ a: undefined, b: 1, c: null }, false, true)._url).toBe(_URL + "?b=1")
714715
expect(w.query({ array: ["a", "b", undefined, "c"] })._url).toBe(_URL + "?array=a&array=b&array=&array=c")
715716
})
716717
})

0 commit comments

Comments
 (0)