Skip to content

Commit e22da96

Browse files
committed
add test for bigint in defaultSerializeQueryArgs
1 parent ae838b4 commit e22da96

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/toolkit/src/query/tests/defaultSerializeQueryArgs.test.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ test('number arg', () => {
2323
).toMatchInlineSnapshot(`"test(5)"`)
2424
})
2525

26+
test('bigint arg has non-default serialization (intead of throwing)', () => {
27+
expect(
28+
defaultSerializeQueryArgs({
29+
endpointDefinition,
30+
endpointName,
31+
queryArgs: BigInt(10),
32+
}),
33+
).toMatchInlineSnapshot(`"test({"$bigint":"10"})"`)
34+
})
35+
2636
test('simple object arg is sorted', () => {
2737
expect(
2838
defaultSerializeQueryArgs({

0 commit comments

Comments
 (0)