@@ -41,13 +41,14 @@ describe("get (only URL)", () => {
41
41
openapiTSFetch . configure ( {
42
42
init : { baseUrl : BASE_URL } ,
43
43
} ) ;
44
+ let openapiTSFetchGET = openapiTSFetch . path ( "/url" ) . method ( "get" ) . create ( ) ;
44
45
45
46
bench ( "openapi-fetch" , async ( ) => {
46
47
await openapiFetch . GET ( "/url" ) ;
47
48
} ) ;
48
49
49
50
bench ( "openapi-typescript-fetch" , async ( ) => {
50
- await openapiTSFetch . path ( "/url" ) . method ( "get" ) . create ( ) ( ) ;
51
+ await openapiTSFetchGET ( ) ;
51
52
} ) ;
52
53
53
54
bench ( "openapi-typescript-codegen" , async ( ) => {
@@ -76,6 +77,7 @@ describe("get (headers)", () => {
76
77
openapiTSFetch . configure ( {
77
78
init : { baseUrl : BASE_URL , headers : { "x-base-header" : 123 } } ,
78
79
} ) ;
80
+ let openapiTSFetchGET = openapiTSFetch . path ( "/url" ) . method ( "get" ) . create ( ) ;
79
81
80
82
bench ( "openapi-fetch" , async ( ) => {
81
83
await openapiFetch . GET ( "/url" , {
@@ -84,7 +86,7 @@ describe("get (headers)", () => {
84
86
} ) ;
85
87
86
88
bench ( "openapi-typescript-fetch" , async ( ) => {
87
- await openapiTSFetch . path ( "/url" ) . method ( "get" ) . create ( ) ( null , {
89
+ await openapiTSFetchGET ( null , {
88
90
headers : { "x-header-1" : 123 , "x-header-2" : 456 } ,
89
91
} ) ;
90
92
} ) ;
0 commit comments