Skip to content

Commit a7df1f2

Browse files
committed
test(valibot): remove redundant assertion checks
1 parent 69ec010 commit a7df1f2

File tree

2 files changed

+0
-402
lines changed

2 files changed

+0
-402
lines changed

packages/openapi-ts-tests/main/test/plugins/valibot/test/numberTypeToValibotSchema/const-values.test.ts

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ describe('Number Type Const Values Tests', () => {
1414
it('should accept exact const value', () => {
1515
const result = v.safeParse(generatedSchemas.vNumberNoFormat, 42.5);
1616
expect(result.success).toBe(true);
17-
if (result.success) {
18-
expect(result.output).toBe(42.5);
19-
}
2017
});
2118

2219
it('should reject non-matching values', () => {
@@ -29,9 +26,6 @@ describe('Number Type Const Values Tests', () => {
2926
it('should accept NumberInt8 exact const value', () => {
3027
const result = v.safeParse(generatedSchemas.vNumberInt8, 100);
3128
expect(result.success).toBe(true);
32-
if (result.success) {
33-
expect(result.output).toBe(100);
34-
}
3529
});
3630

3731
it('should reject NumberInt8 non-matching values', () => {
@@ -42,9 +36,6 @@ describe('Number Type Const Values Tests', () => {
4236
it('should accept NumberInt16 exact const value', () => {
4337
const result = v.safeParse(generatedSchemas.vNumberInt16, 1000);
4438
expect(result.success).toBe(true);
45-
if (result.success) {
46-
expect(result.output).toBe(1000);
47-
}
4839
});
4940

5041
it('should reject NumberInt16 non-matching values', () => {
@@ -55,9 +46,6 @@ describe('Number Type Const Values Tests', () => {
5546
it('should accept NumberInt32 exact const value', () => {
5647
const result = v.safeParse(generatedSchemas.vNumberInt32, 100000);
5748
expect(result.success).toBe(true);
58-
if (result.success) {
59-
expect(result.output).toBe(100000);
60-
}
6149
});
6250

6351
it('should reject NumberInt32 non-matching values', () => {
@@ -71,9 +59,6 @@ describe('Number Type Const Values Tests', () => {
7159
BigInt('1000000000000'),
7260
);
7361
expect(result.success).toBe(true);
74-
if (result.success) {
75-
expect(result.output).toBe(BigInt('1000000000000'));
76-
}
7762
});
7863

7964
it('should reject NumberInt64 non-matching values', () => {
@@ -87,9 +72,6 @@ describe('Number Type Const Values Tests', () => {
8772
it('should accept NumberUint8 exact const value', () => {
8873
const result = v.safeParse(generatedSchemas.vNumberUint8, 200);
8974
expect(result.success).toBe(true);
90-
if (result.success) {
91-
expect(result.output).toBe(200);
92-
}
9375
});
9476

9577
it('should reject NumberUint8 non-matching values', () => {
@@ -100,9 +82,6 @@ describe('Number Type Const Values Tests', () => {
10082
it('should accept NumberUint16 exact const value', () => {
10183
const result = v.safeParse(generatedSchemas.vNumberUint16, 50000);
10284
expect(result.success).toBe(true);
103-
if (result.success) {
104-
expect(result.output).toBe(50000);
105-
}
10685
});
10786

10887
it('should reject NumberUint16 non-matching values', () => {
@@ -113,9 +92,6 @@ describe('Number Type Const Values Tests', () => {
11392
it('should accept NumberUint32 exact const value', () => {
11493
const result = v.safeParse(generatedSchemas.vNumberUint32, 3000000000);
11594
expect(result.success).toBe(true);
116-
if (result.success) {
117-
expect(result.output).toBe(3000000000);
118-
}
11995
});
12096

12197
it('should reject NumberUint32 non-matching values', () => {
@@ -129,9 +105,6 @@ describe('Number Type Const Values Tests', () => {
129105
BigInt('18000000000000000000'),
130106
);
131107
expect(result.success).toBe(true);
132-
if (result.success) {
133-
expect(result.output).toBe(BigInt('18000000000000000000'));
134-
}
135108
});
136109

137110
it('should reject NumberUint64 non-matching values', () => {
@@ -147,9 +120,6 @@ describe('Number Type Const Values Tests', () => {
147120
it('should accept exact const value', () => {
148121
const result = v.safeParse(generatedSchemas.vIntegerNoFormat, -1);
149122
expect(result.success).toBe(true);
150-
if (result.success) {
151-
expect(result.output).toBe(-1);
152-
}
153123
});
154124

155125
it('should reject non-matching values', () => {
@@ -162,9 +132,6 @@ describe('Number Type Const Values Tests', () => {
162132
it('should accept IntegerInt8 exact const value', () => {
163133
const result = v.safeParse(generatedSchemas.vIntegerInt8, -100);
164134
expect(result.success).toBe(true);
165-
if (result.success) {
166-
expect(result.output).toBe(-100);
167-
}
168135
});
169136

170137
it('should reject IntegerInt8 non-matching values', () => {
@@ -175,9 +142,6 @@ describe('Number Type Const Values Tests', () => {
175142
it('should accept IntegerInt16 exact const value', () => {
176143
const result = v.safeParse(generatedSchemas.vIntegerInt16, -1000);
177144
expect(result.success).toBe(true);
178-
if (result.success) {
179-
expect(result.output).toBe(-1000);
180-
}
181145
});
182146

183147
it('should reject IntegerInt16 non-matching values', () => {
@@ -188,9 +152,6 @@ describe('Number Type Const Values Tests', () => {
188152
it('should accept IntegerInt32 exact const value', () => {
189153
const result = v.safeParse(generatedSchemas.vIntegerInt32, -100000);
190154
expect(result.success).toBe(true);
191-
if (result.success) {
192-
expect(result.output).toBe(-100000);
193-
}
194155
});
195156

196157
it('should reject IntegerInt32 non-matching values', () => {
@@ -204,9 +165,6 @@ describe('Number Type Const Values Tests', () => {
204165
BigInt('-1000000000000'),
205166
);
206167
expect(result.success).toBe(true);
207-
if (result.success) {
208-
expect(result.output).toBe(BigInt('-1000000000000'));
209-
}
210168
});
211169

212170
it('should reject IntegerInt64 non-matching values', () => {
@@ -220,9 +178,6 @@ describe('Number Type Const Values Tests', () => {
220178
it('should accept IntegerUint8 exact const value', () => {
221179
const result = v.safeParse(generatedSchemas.vIntegerUint8, 255);
222180
expect(result.success).toBe(true);
223-
if (result.success) {
224-
expect(result.output).toBe(255);
225-
}
226181
});
227182

228183
it('should reject IntegerUint8 non-matching values', () => {
@@ -233,9 +188,6 @@ describe('Number Type Const Values Tests', () => {
233188
it('should accept IntegerUint16 exact const value', () => {
234189
const result = v.safeParse(generatedSchemas.vIntegerUint16, 65535);
235190
expect(result.success).toBe(true);
236-
if (result.success) {
237-
expect(result.output).toBe(65535);
238-
}
239191
});
240192

241193
it('should reject IntegerUint16 non-matching values', () => {
@@ -246,9 +198,6 @@ describe('Number Type Const Values Tests', () => {
246198
it('should accept IntegerUint32 exact const value', () => {
247199
const result = v.safeParse(generatedSchemas.vIntegerUint32, 4294967295);
248200
expect(result.success).toBe(true);
249-
if (result.success) {
250-
expect(result.output).toBe(4294967295);
251-
}
252201
});
253202

254203
it('should reject IntegerUint32 non-matching values', () => {
@@ -262,9 +211,6 @@ describe('Number Type Const Values Tests', () => {
262211
BigInt('1000000000000'),
263212
);
264213
expect(result.success).toBe(true);
265-
if (result.success) {
266-
expect(result.output).toBe(BigInt('1000000000000'));
267-
}
268214
});
269215

270216
it('should reject IntegerUint64 non-matching values', () => {
@@ -283,9 +229,6 @@ describe('Number Type Const Values Tests', () => {
283229
BigInt('-9223372036854775808'),
284230
);
285231
expect(result.success).toBe(true);
286-
if (result.success) {
287-
expect(result.output).toBe(BigInt('-9223372036854775808'));
288-
}
289232
});
290233

291234
it('should reject StringInt64 non-matching values', () => {
@@ -302,9 +245,6 @@ describe('Number Type Const Values Tests', () => {
302245
BigInt('18446744073709551615'),
303246
);
304247
expect(result.success).toBe(true);
305-
if (result.success) {
306-
expect(result.output).toBe(BigInt('18446744073709551615'));
307-
}
308248
});
309249

310250
it('should reject StringUint64 non-matching values', () => {
@@ -323,9 +263,6 @@ describe('Number Type Const Values Tests', () => {
323263
BigInt('-9223372036854775808'),
324264
);
325265
expect(result.success).toBe(true);
326-
if (result.success) {
327-
expect(result.output).toBe(BigInt('-9223372036854775808'));
328-
}
329266
});
330267

331268
it('should reject StringInt64n non-matching values', () => {
@@ -342,9 +279,6 @@ describe('Number Type Const Values Tests', () => {
342279
BigInt('18446744073709551615'),
343280
);
344281
expect(result.success).toBe(true);
345-
if (result.success) {
346-
expect(result.output).toBe(BigInt('18446744073709551615'));
347-
}
348282
});
349283

350284
it('should reject StringUint64n non-matching values', () => {

0 commit comments

Comments
 (0)