Skip to content

Commit de16ae4

Browse files
razor-xseambot
andauthored
test: Add test for UnserializableParamError on empty string (#21)
* test: Add test for UnserializableParamError on empty string * ci: Format code --------- Co-authored-by: Seam Bot <[email protected]>
1 parent 3a01cc9 commit de16ae4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/serialization.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ test('cannot serialize non-plain objects', (t) => {
149149
})
150150
})
151151

152+
test('cannot serialize the empty string', (t) => {
153+
t.throws(() => serializeUrlSearchParams({ foo: '' }), {
154+
instanceOf: UnserializableParamError,
155+
})
156+
})
157+
152158
test('cannot serialize array params with unserializable values', (t) => {
153159
t.throws(() => serializeUrlSearchParams({ foo: [''] }), {
154160
instanceOf: UnserializableParamError,

0 commit comments

Comments
 (0)