@@ -60,25 +60,25 @@ describe('TemplateJson', () => {
60
60
test ( 'can specify int64 range' , ( ) => {
61
61
resetMathRandom ( ) ;
62
62
const result1 = TemplateJson . gen ( [ 'int64' , BigInt ( - 10 ) , BigInt ( 10 ) ] ) as bigint ;
63
- expect ( result1 ) . toBe ( BigInt ( - 9 ) ) ;
63
+ expect ( result1 . toString ( ) ) . toBe ( '-9' ) ;
64
64
65
65
const result2 = TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 1 ) ] ) as bigint ;
66
- expect ( result2 ) . toBe ( BigInt ( 0 ) ) ;
66
+ expect ( result2 . toString ( ) ) . toBe ( '0' ) ;
67
67
68
68
const result3 = TemplateJson . gen ( [ 'int64' , BigInt ( 1 ) , BigInt ( 5 ) ] ) as bigint ;
69
- expect ( result3 ) . toBe ( BigInt ( 4 ) ) ;
69
+ expect ( result3 . toString ( ) ) . toBe ( '3' ) ;
70
70
} ) ;
71
71
72
72
test ( 'handles edge cases' , ( ) => {
73
73
resetMathRandom ( ) ;
74
74
const result1 = TemplateJson . gen ( [ 'int64' , BigInt ( 0 ) , BigInt ( 0 ) ] ) as bigint ;
75
- expect ( result1 ) . toBe ( BigInt ( 0 ) ) ;
75
+ expect ( result1 . toString ( ) ) . toBe ( '0' ) ;
76
76
77
77
const result2 = TemplateJson . gen ( [ 'int64' , BigInt ( - 1 ) , BigInt ( - 1 ) ] ) as bigint ;
78
- expect ( result2 ) . toBe ( BigInt ( - 1 ) ) ;
78
+ expect ( result2 . toString ( ) ) . toBe ( '-1' ) ;
79
79
80
80
const result3 = TemplateJson . gen ( [ 'int64' , BigInt ( '1000000000000' ) , BigInt ( '1000000000000' ) ] ) as bigint ;
81
- expect ( result3 ) . toBe ( BigInt ( '1000000000000' ) ) ;
81
+ expect ( result3 . toString ( ) ) . toBe ( '1000000000000' ) ;
82
82
} ) ;
83
83
84
84
test ( 'handles very large ranges' , ( ) => {
0 commit comments