@@ -14,9 +14,6 @@ describe('Number Type Const Values Tests', () => {
14
14
it ( 'should accept exact const value' , ( ) => {
15
15
const result = v . safeParse ( generatedSchemas . vNumberNoFormat , 42.5 ) ;
16
16
expect ( result . success ) . toBe ( true ) ;
17
- if ( result . success ) {
18
- expect ( result . output ) . toBe ( 42.5 ) ;
19
- }
20
17
} ) ;
21
18
22
19
it ( 'should reject non-matching values' , ( ) => {
@@ -29,9 +26,6 @@ describe('Number Type Const Values Tests', () => {
29
26
it ( 'should accept NumberInt8 exact const value' , ( ) => {
30
27
const result = v . safeParse ( generatedSchemas . vNumberInt8 , 100 ) ;
31
28
expect ( result . success ) . toBe ( true ) ;
32
- if ( result . success ) {
33
- expect ( result . output ) . toBe ( 100 ) ;
34
- }
35
29
} ) ;
36
30
37
31
it ( 'should reject NumberInt8 non-matching values' , ( ) => {
@@ -42,9 +36,6 @@ describe('Number Type Const Values Tests', () => {
42
36
it ( 'should accept NumberInt16 exact const value' , ( ) => {
43
37
const result = v . safeParse ( generatedSchemas . vNumberInt16 , 1000 ) ;
44
38
expect ( result . success ) . toBe ( true ) ;
45
- if ( result . success ) {
46
- expect ( result . output ) . toBe ( 1000 ) ;
47
- }
48
39
} ) ;
49
40
50
41
it ( 'should reject NumberInt16 non-matching values' , ( ) => {
@@ -55,9 +46,6 @@ describe('Number Type Const Values Tests', () => {
55
46
it ( 'should accept NumberInt32 exact const value' , ( ) => {
56
47
const result = v . safeParse ( generatedSchemas . vNumberInt32 , 100000 ) ;
57
48
expect ( result . success ) . toBe ( true ) ;
58
- if ( result . success ) {
59
- expect ( result . output ) . toBe ( 100000 ) ;
60
- }
61
49
} ) ;
62
50
63
51
it ( 'should reject NumberInt32 non-matching values' , ( ) => {
@@ -71,9 +59,6 @@ describe('Number Type Const Values Tests', () => {
71
59
BigInt ( '1000000000000' ) ,
72
60
) ;
73
61
expect ( result . success ) . toBe ( true ) ;
74
- if ( result . success ) {
75
- expect ( result . output ) . toBe ( BigInt ( '1000000000000' ) ) ;
76
- }
77
62
} ) ;
78
63
79
64
it ( 'should reject NumberInt64 non-matching values' , ( ) => {
@@ -87,9 +72,6 @@ describe('Number Type Const Values Tests', () => {
87
72
it ( 'should accept NumberUint8 exact const value' , ( ) => {
88
73
const result = v . safeParse ( generatedSchemas . vNumberUint8 , 200 ) ;
89
74
expect ( result . success ) . toBe ( true ) ;
90
- if ( result . success ) {
91
- expect ( result . output ) . toBe ( 200 ) ;
92
- }
93
75
} ) ;
94
76
95
77
it ( 'should reject NumberUint8 non-matching values' , ( ) => {
@@ -100,9 +82,6 @@ describe('Number Type Const Values Tests', () => {
100
82
it ( 'should accept NumberUint16 exact const value' , ( ) => {
101
83
const result = v . safeParse ( generatedSchemas . vNumberUint16 , 50000 ) ;
102
84
expect ( result . success ) . toBe ( true ) ;
103
- if ( result . success ) {
104
- expect ( result . output ) . toBe ( 50000 ) ;
105
- }
106
85
} ) ;
107
86
108
87
it ( 'should reject NumberUint16 non-matching values' , ( ) => {
@@ -113,9 +92,6 @@ describe('Number Type Const Values Tests', () => {
113
92
it ( 'should accept NumberUint32 exact const value' , ( ) => {
114
93
const result = v . safeParse ( generatedSchemas . vNumberUint32 , 3000000000 ) ;
115
94
expect ( result . success ) . toBe ( true ) ;
116
- if ( result . success ) {
117
- expect ( result . output ) . toBe ( 3000000000 ) ;
118
- }
119
95
} ) ;
120
96
121
97
it ( 'should reject NumberUint32 non-matching values' , ( ) => {
@@ -129,9 +105,6 @@ describe('Number Type Const Values Tests', () => {
129
105
BigInt ( '18000000000000000000' ) ,
130
106
) ;
131
107
expect ( result . success ) . toBe ( true ) ;
132
- if ( result . success ) {
133
- expect ( result . output ) . toBe ( BigInt ( '18000000000000000000' ) ) ;
134
- }
135
108
} ) ;
136
109
137
110
it ( 'should reject NumberUint64 non-matching values' , ( ) => {
@@ -147,9 +120,6 @@ describe('Number Type Const Values Tests', () => {
147
120
it ( 'should accept exact const value' , ( ) => {
148
121
const result = v . safeParse ( generatedSchemas . vIntegerNoFormat , - 1 ) ;
149
122
expect ( result . success ) . toBe ( true ) ;
150
- if ( result . success ) {
151
- expect ( result . output ) . toBe ( - 1 ) ;
152
- }
153
123
} ) ;
154
124
155
125
it ( 'should reject non-matching values' , ( ) => {
@@ -162,9 +132,6 @@ describe('Number Type Const Values Tests', () => {
162
132
it ( 'should accept IntegerInt8 exact const value' , ( ) => {
163
133
const result = v . safeParse ( generatedSchemas . vIntegerInt8 , - 100 ) ;
164
134
expect ( result . success ) . toBe ( true ) ;
165
- if ( result . success ) {
166
- expect ( result . output ) . toBe ( - 100 ) ;
167
- }
168
135
} ) ;
169
136
170
137
it ( 'should reject IntegerInt8 non-matching values' , ( ) => {
@@ -175,9 +142,6 @@ describe('Number Type Const Values Tests', () => {
175
142
it ( 'should accept IntegerInt16 exact const value' , ( ) => {
176
143
const result = v . safeParse ( generatedSchemas . vIntegerInt16 , - 1000 ) ;
177
144
expect ( result . success ) . toBe ( true ) ;
178
- if ( result . success ) {
179
- expect ( result . output ) . toBe ( - 1000 ) ;
180
- }
181
145
} ) ;
182
146
183
147
it ( 'should reject IntegerInt16 non-matching values' , ( ) => {
@@ -188,9 +152,6 @@ describe('Number Type Const Values Tests', () => {
188
152
it ( 'should accept IntegerInt32 exact const value' , ( ) => {
189
153
const result = v . safeParse ( generatedSchemas . vIntegerInt32 , - 100000 ) ;
190
154
expect ( result . success ) . toBe ( true ) ;
191
- if ( result . success ) {
192
- expect ( result . output ) . toBe ( - 100000 ) ;
193
- }
194
155
} ) ;
195
156
196
157
it ( 'should reject IntegerInt32 non-matching values' , ( ) => {
@@ -204,9 +165,6 @@ describe('Number Type Const Values Tests', () => {
204
165
BigInt ( '-1000000000000' ) ,
205
166
) ;
206
167
expect ( result . success ) . toBe ( true ) ;
207
- if ( result . success ) {
208
- expect ( result . output ) . toBe ( BigInt ( '-1000000000000' ) ) ;
209
- }
210
168
} ) ;
211
169
212
170
it ( 'should reject IntegerInt64 non-matching values' , ( ) => {
@@ -220,9 +178,6 @@ describe('Number Type Const Values Tests', () => {
220
178
it ( 'should accept IntegerUint8 exact const value' , ( ) => {
221
179
const result = v . safeParse ( generatedSchemas . vIntegerUint8 , 255 ) ;
222
180
expect ( result . success ) . toBe ( true ) ;
223
- if ( result . success ) {
224
- expect ( result . output ) . toBe ( 255 ) ;
225
- }
226
181
} ) ;
227
182
228
183
it ( 'should reject IntegerUint8 non-matching values' , ( ) => {
@@ -233,9 +188,6 @@ describe('Number Type Const Values Tests', () => {
233
188
it ( 'should accept IntegerUint16 exact const value' , ( ) => {
234
189
const result = v . safeParse ( generatedSchemas . vIntegerUint16 , 65535 ) ;
235
190
expect ( result . success ) . toBe ( true ) ;
236
- if ( result . success ) {
237
- expect ( result . output ) . toBe ( 65535 ) ;
238
- }
239
191
} ) ;
240
192
241
193
it ( 'should reject IntegerUint16 non-matching values' , ( ) => {
@@ -246,9 +198,6 @@ describe('Number Type Const Values Tests', () => {
246
198
it ( 'should accept IntegerUint32 exact const value' , ( ) => {
247
199
const result = v . safeParse ( generatedSchemas . vIntegerUint32 , 4294967295 ) ;
248
200
expect ( result . success ) . toBe ( true ) ;
249
- if ( result . success ) {
250
- expect ( result . output ) . toBe ( 4294967295 ) ;
251
- }
252
201
} ) ;
253
202
254
203
it ( 'should reject IntegerUint32 non-matching values' , ( ) => {
@@ -262,9 +211,6 @@ describe('Number Type Const Values Tests', () => {
262
211
BigInt ( '1000000000000' ) ,
263
212
) ;
264
213
expect ( result . success ) . toBe ( true ) ;
265
- if ( result . success ) {
266
- expect ( result . output ) . toBe ( BigInt ( '1000000000000' ) ) ;
267
- }
268
214
} ) ;
269
215
270
216
it ( 'should reject IntegerUint64 non-matching values' , ( ) => {
@@ -283,9 +229,6 @@ describe('Number Type Const Values Tests', () => {
283
229
BigInt ( '-9223372036854775808' ) ,
284
230
) ;
285
231
expect ( result . success ) . toBe ( true ) ;
286
- if ( result . success ) {
287
- expect ( result . output ) . toBe ( BigInt ( '-9223372036854775808' ) ) ;
288
- }
289
232
} ) ;
290
233
291
234
it ( 'should reject StringInt64 non-matching values' , ( ) => {
@@ -302,9 +245,6 @@ describe('Number Type Const Values Tests', () => {
302
245
BigInt ( '18446744073709551615' ) ,
303
246
) ;
304
247
expect ( result . success ) . toBe ( true ) ;
305
- if ( result . success ) {
306
- expect ( result . output ) . toBe ( BigInt ( '18446744073709551615' ) ) ;
307
- }
308
248
} ) ;
309
249
310
250
it ( 'should reject StringUint64 non-matching values' , ( ) => {
@@ -323,9 +263,6 @@ describe('Number Type Const Values Tests', () => {
323
263
BigInt ( '-9223372036854775808' ) ,
324
264
) ;
325
265
expect ( result . success ) . toBe ( true ) ;
326
- if ( result . success ) {
327
- expect ( result . output ) . toBe ( BigInt ( '-9223372036854775808' ) ) ;
328
- }
329
266
} ) ;
330
267
331
268
it ( 'should reject StringInt64n non-matching values' , ( ) => {
@@ -342,9 +279,6 @@ describe('Number Type Const Values Tests', () => {
342
279
BigInt ( '18446744073709551615' ) ,
343
280
) ;
344
281
expect ( result . success ) . toBe ( true ) ;
345
- if ( result . success ) {
346
- expect ( result . output ) . toBe ( BigInt ( '18446744073709551615' ) ) ;
347
- }
348
282
} ) ;
349
283
350
284
it ( 'should reject StringUint64n non-matching values' , ( ) => {
0 commit comments