@@ -227,6 +227,8 @@ describe("client", () => {
227
227
} ) ;
228
228
229
229
describe ( "body" , ( ) => {
230
+ // these are pure type tests; no runtime assertions needed
231
+ /* eslint-disable vitest/expect-expect */
230
232
it ( "requires necessary requestBodies" , async ( ) => {
231
233
const client = createClient < paths > ( { baseUrl : "https://myapi.com/v1" } ) ;
232
234
mockFetch ( { status : 200 , body : JSON . stringify ( { message : "OK" } ) } ) ;
@@ -285,6 +287,7 @@ describe("client", () => {
285
287
} ) ;
286
288
} ) ;
287
289
} ) ;
290
+ /* eslint-enable vitest/expect-expect */
288
291
} ) ;
289
292
290
293
describe ( "options" , ( ) => {
@@ -408,7 +411,7 @@ describe("client", () => {
408
411
expect ( response . status ) . toBe ( 204 ) ;
409
412
410
413
// assert error is empty
411
- expect ( error ) . toBe ( undefined ) ;
414
+ expect ( error ) . toBeUndefined ( ) ;
412
415
} ) ;
413
416
414
417
it ( "treats `default` as an error" , async ( ) => {
@@ -478,7 +481,7 @@ describe("client", () => {
478
481
expect ( response . status ) . toBe ( 200 ) ;
479
482
480
483
// assert error is empty
481
- expect ( error ) . toBe ( undefined ) ;
484
+ expect ( error ) . toBeUndefined ( ) ;
482
485
} ) ;
483
486
484
487
it ( "sends correct options, returns error" , async ( ) => {
@@ -500,7 +503,7 @@ describe("client", () => {
500
503
expect ( response . status ) . toBe ( 404 ) ;
501
504
502
505
// assert data is empty
503
- expect ( data ) . toBe ( undefined ) ;
506
+ expect ( data ) . toBeUndefined ( ) ;
504
507
} ) ;
505
508
506
509
// note: this was a previous bug in the type inference
@@ -543,7 +546,7 @@ describe("client", () => {
543
546
expect ( response . status ) . toBe ( 201 ) ;
544
547
545
548
// assert error is empty
546
- expect ( error ) . toBe ( undefined ) ;
549
+ expect ( error ) . toBeUndefined ( ) ;
547
550
} ) ;
548
551
549
552
it ( "supports sepecifying utf-8 encoding" , async ( ) => {
@@ -563,7 +566,7 @@ describe("client", () => {
563
566
expect ( response . status ) . toBe ( 201 ) ;
564
567
565
568
// assert error is empty
566
- expect ( error ) . toBe ( undefined ) ;
569
+ expect ( error ) . toBeUndefined ( ) ;
567
570
} ) ;
568
571
} ) ;
569
572
@@ -588,7 +591,7 @@ describe("client", () => {
588
591
expect ( data ) . toEqual ( { } ) ;
589
592
590
593
// assert error is empty
591
- expect ( error ) . toBe ( undefined ) ;
594
+ expect ( error ) . toBeUndefined ( ) ;
592
595
} ) ;
593
596
594
597
it ( "returns empty object on Content-Length: 0" , async ( ) => {
@@ -604,7 +607,7 @@ describe("client", () => {
604
607
expect ( data ) . toEqual ( { } ) ;
605
608
606
609
// assert error is empty
607
- expect ( error ) . toBe ( undefined ) ;
610
+ expect ( error ) . toBeUndefined ( ) ;
608
611
} ) ;
609
612
} ) ;
610
613
0 commit comments