@@ -59,18 +59,26 @@ describe('TemplateJson', () => {
5959
6060 test ( 'can specify int64 range' , ( ) => {
6161 resetMathRandom ( ) ;
62- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( - 10 ) , BigInt ( 10 ) ] ) ) . toBe ( BigInt ( - 9 ) ) ;
63- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 1 ) ] ) ) . toBe ( BigInt ( 0 ) ) ;
64- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( 1 ) , BigInt ( 5 ) ] ) ) . toBe ( BigInt ( 4 ) ) ;
62+ const result1 = TemplateJson . gen ( [ 'int64' , BigInt ( - 10 ) , BigInt ( 10 ) ] ) as bigint ;
63+ expect ( result1 ) . toBe ( BigInt ( - 9 ) ) ;
64+
65+ const result2 = TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 1 ) ] ) as bigint ;
66+ expect ( result2 ) . toBe ( BigInt ( 0 ) ) ;
67+
68+ const result3 = TemplateJson . gen ( [ 'int64' , BigInt ( 1 ) , BigInt ( 5 ) ] ) as bigint ;
69+ expect ( result3 ) . toBe ( BigInt ( 4 ) ) ;
6570 } ) ;
6671
6772 test ( 'handles edge cases' , ( ) => {
6873 resetMathRandom ( ) ;
69- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 0 ) ] ) ) . toBe ( BigInt ( 0 ) ) ;
70- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( - 1 ) , BigInt ( - 1 ) ] ) ) . toBe ( BigInt ( - 1 ) ) ;
71- expect ( TemplateJson . gen ( [ 'int64' , BigInt ( '1000000000000' ) , BigInt ( '1000000000000' ) ] ) ) . toBe (
72- BigInt ( '1000000000000' ) ,
73- ) ;
74+ const result1 = TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 0 ) ] ) as bigint ;
75+ expect ( result1 ) . toBe ( BigInt ( 0 ) ) ;
76+
77+ const result2 = TemplateJson . gen ( [ 'int64' , BigInt ( - 1 ) , BigInt ( - 1 ) ] ) as bigint ;
78+ expect ( result2 ) . toBe ( BigInt ( - 1 ) ) ;
79+
80+ const result3 = TemplateJson . gen ( [ 'int64' , BigInt ( '1000000000000' ) , BigInt ( '1000000000000' ) ] ) as bigint ;
81+ expect ( result3 ) . toBe ( BigInt ( '1000000000000' ) ) ;
7482 } ) ;
7583
7684 test ( 'handles very large ranges' , ( ) => {
0 commit comments