@@ -470,6 +470,18 @@ describe('Valibot', () => {
470470 ) . not . toThrow ( ) ;
471471 } ) ;
472472
473+ it ( 'should handle bigint' , async ( ) => {
474+ const schema = v . object ( {
475+ id : v . bigint ( )
476+ } ) ;
477+ const data = new FormData ( ) ;
478+ data . set ( 'id' , '123456789123456789' ) ;
479+
480+ const form = await superValidate ( data , valibot ( schema ) ) ;
481+ expect ( form . valid ) . toBe ( true ) ;
482+ expect ( form . data ) . toEqual ( { id : BigInt ( '123456789123456789' ) } ) ;
483+ } ) ;
484+
473485 /*
474486 it('should work with FormPathLeaves and brand', async () => {
475487 const schema = v.object({ id: v.brand(v.string(), 'Id') });
@@ -976,7 +988,7 @@ describe('Zod 4', () => {
976988 'enumDef'
977989 ] ) ;
978990 expect ( adapter . defaults ) . toEqual ( {
979- nativeEnumInt : 'Apple' ,
991+ nativeEnumInt : 7 ,
980992 nativeEnumString : 'GREEN' ,
981993 enum : 'a' ,
982994 enumDef : ''
@@ -1097,6 +1109,18 @@ describe('Zod 4', () => {
10971109 } ) ;
10981110 } ) ;
10991111
1112+ it ( 'should work with bigint' , async ( ) => {
1113+ const schema = z4 . object ( {
1114+ id : z4 . bigint ( )
1115+ } ) ;
1116+ const data = new FormData ( ) ;
1117+ data . set ( 'id' , '123456789123456789' ) ;
1118+
1119+ const form = await superValidate ( data , zod4 ( schema ) ) ;
1120+ expect ( form . valid ) . toBe ( true ) ;
1121+ expect ( form . data ) . toEqual ( { id : BigInt ( '123456789123456789' ) } ) ;
1122+ } ) ;
1123+
11001124 schemaTest ( zod4 ( schema ) , undefined , undefined , undefined , 'zod4' ) ;
11011125} ) ;
11021126
0 commit comments