Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2dcb6eb

Browse files
authoredFeb 27, 2024
fix: openapi-typescript-fetch bench (#1566)
1 parent 6fe2c85 commit 2dcb6eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎packages/openapi-fetch/test/index.bench.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ describe("get (only URL)", () => {
4141
openapiTSFetch.configure({
4242
init: { baseUrl: BASE_URL },
4343
});
44+
let openapiTSFetchGET = openapiTSFetch.path("/url").method("get").create();
4445

4546
bench("openapi-fetch", async () => {
4647
await openapiFetch.GET("/url");
4748
});
4849

4950
bench("openapi-typescript-fetch", async () => {
50-
await openapiTSFetch.path("/url").method("get").create()();
51+
await openapiTSFetchGET();
5152
});
5253

5354
bench("openapi-typescript-codegen", async () => {
@@ -76,6 +77,7 @@ describe("get (headers)", () => {
7677
openapiTSFetch.configure({
7778
init: { baseUrl: BASE_URL, headers: { "x-base-header": 123 } },
7879
});
80+
let openapiTSFetchGET = openapiTSFetch.path("/url").method("get").create();
7981

8082
bench("openapi-fetch", async () => {
8183
await openapiFetch.GET("/url", {
@@ -84,7 +86,7 @@ describe("get (headers)", () => {
8486
});
8587

8688
bench("openapi-typescript-fetch", async () => {
87-
await openapiTSFetch.path("/url").method("get").create()(null, {
89+
await openapiTSFetchGET(null, {
8890
headers: { "x-header-1": 123, "x-header-2": 456 },
8991
});
9092
});

0 commit comments

Comments
 (0)
Please sign in to comment.