1- import { describe , expect , test } from "vitest" ;
1+ import { describe , expect , test , assertType } from "vitest" ;
22import { createObservedClient } from "../helpers.js" ;
33import type { paths } from "./schemas/delete.js" ;
44
@@ -10,7 +10,8 @@ describe("DELETE", () => {
1010 } ) ;
1111
1212 // assert correct data was returned
13- expect ( data ) . toEqual ( { } ) ;
13+ assertType < undefined > ( data ) ;
14+ expect ( data ) . toEqual ( undefined ) ;
1415 expect ( response . status ) . toBe ( 204 ) ;
1516
1617 // assert error is empty
@@ -27,7 +28,7 @@ describe("DELETE", () => {
2728 expect ( method ) . toBe ( "DELETE" ) ;
2829 } ) ;
2930
30- test ( "returns empty object on Content-Length: 0" , async ( ) => {
31+ test ( "returns undefined on Content-Length: 0" , async ( ) => {
3132 const client = createObservedClient < paths > (
3233 { } ,
3334 async ( ) => new Response ( null , { status : 200 , headers : { "Content-Length" : "0" } } ) ,
@@ -39,7 +40,8 @@ describe("DELETE", () => {
3940 } ) ;
4041
4142 // assert correct data was returned
42- expect ( data ) . toEqual ( { } ) ;
43+ assertType < undefined > ( data ) ;
44+ expect ( data ) . toEqual ( undefined ) ;
4345
4446 // assert error is empty
4547 expect ( error ) . toBeUndefined ( ) ;
0 commit comments