Skip to content

Commit 84eea31

Browse files
committed
test(valibot): remove redundant if conditions
1 parent 4147808 commit 84eea31

File tree

1 file changed

+8
-24
lines changed
  • packages/openapi-ts-tests/main/test/plugins/valibot/test/numberTypeToValibotSchema

1 file changed

+8
-24
lines changed

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

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ describe('Number Type Formats Tests', () => {
146146
1000000000000,
147147
);
148148
expect(result.success).toBe(true);
149-
if (result.success) {
150-
expect(typeof result.output).toBe('bigint');
151-
}
149+
expect(typeof result.output).toBe('bigint');
152150
});
153151

154152
it('should validate string values within int64 range', () => {
@@ -157,9 +155,7 @@ describe('Number Type Formats Tests', () => {
157155
'1000000000000',
158156
);
159157
expect(result.success).toBe(true);
160-
if (result.success) {
161-
expect(typeof result.output).toBe('bigint');
162-
}
158+
expect(typeof result.output).toBe('bigint');
163159
});
164160

165161
it('should reject values above int64 maximum', () => {
@@ -250,9 +246,7 @@ describe('Number Type Formats Tests', () => {
250246
1000000000000,
251247
);
252248
expect(result.success).toBe(true);
253-
if (result.success) {
254-
expect(typeof result.output).toBe('bigint');
255-
}
249+
expect(typeof result.output).toBe('bigint');
256250
});
257251

258252
it('should reject negative values', () => {
@@ -365,9 +359,7 @@ describe('Number Type Formats Tests', () => {
365359
1000000000000,
366360
);
367361
expect(result.success).toBe(true);
368-
if (result.success) {
369-
expect(typeof result.output).toBe('bigint');
370-
}
362+
expect(typeof result.output).toBe('bigint');
371363
});
372364

373365
it('should validate string values within int64 range', () => {
@@ -376,9 +368,7 @@ describe('Number Type Formats Tests', () => {
376368
'1000000000000',
377369
);
378370
expect(result.success).toBe(true);
379-
if (result.success) {
380-
expect(typeof result.output).toBe('bigint');
381-
}
371+
expect(typeof result.output).toBe('bigint');
382372
});
383373

384374
it('should reject values above int64 maximum', () => {
@@ -469,9 +459,7 @@ describe('Number Type Formats Tests', () => {
469459
1000000000000,
470460
);
471461
expect(result.success).toBe(true);
472-
if (result.success) {
473-
expect(typeof result.output).toBe('bigint');
474-
}
462+
expect(typeof result.output).toBe('bigint');
475463
});
476464

477465
it('should reject negative values', () => {
@@ -503,9 +491,7 @@ describe('Number Type Formats Tests', () => {
503491
'1000000000000',
504492
);
505493
expect(result.success).toBe(true);
506-
if (result.success) {
507-
expect(typeof result.output).toBe('bigint');
508-
}
494+
expect(typeof result.output).toBe('bigint');
509495
});
510496

511497
it('should reject values below int64 minimum', () => {
@@ -538,9 +524,7 @@ describe('Number Type Formats Tests', () => {
538524
'1000000000000',
539525
);
540526
expect(result.success).toBe(true);
541-
if (result.success) {
542-
expect(typeof result.output).toBe('bigint');
543-
}
527+
expect(typeof result.output).toBe('bigint');
544528
});
545529

546530
it('should reject negative values', () => {

0 commit comments

Comments
 (0)