Skip to content

Commit 4c42185

Browse files
committed
chore(test): suppress undici 8 Request type mismatch in test fetch wrappers
1 parent 5e12e94 commit 4c42185

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

__tests__/openai.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ describe("OpenAI", () => {
2727
const openAiClient = new OpenAiApiRestClient(apiUrl, {
2828
logger: console.debug,
2929
fetch: (input, init) =>
30-
undiciFetch(input, { ...init, dispatcher: mockAgent }),
30+
undiciFetch(
31+
// @ts-expect-error @types/node resolves fetch types via undici-types@7, but we
32+
// import undici@8 directly — Request.headers.keys() iterator types diverge.
33+
// Fix: remove when @types/node ships undici-types@8
34+
input,
35+
{ ...init, dispatcher: mockAgent },
36+
),
3137
});
3238

3339
const command = new CreateModerationCommand({

__tests__/petstore.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ describe("Petstore", () => {
2929
const petStoreClient = new SwaggerPetstoreRestClient(apiUrl, {
3030
logger: console.log,
3131
fetch: (input, init) =>
32-
undiciFetch(input, { ...init, dispatcher: mockAgent }),
32+
undiciFetch(
33+
// @ts-expect-error @types/node resolves fetch types via undici-types@7, but we
34+
// import undici@8 directly — Request.headers.keys() iterator types diverge.
35+
// Fix: remove when @types/node ships undici-types@8
36+
input,
37+
{ ...init, dispatcher: mockAgent },
38+
),
3339
});
3440
const command = new FindPetsCommand({
3541
limit: "10",

__tests__/test1.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ describe("Test1", () => {
3737
const client = new BillingServiceRestApiRestClient(apiUrl, {
3838
logger: console.debug,
3939
fetch: (input, init) =>
40-
undiciFetch(input, { ...init, dispatcher: mockAgent }),
40+
undiciFetch(
41+
// @ts-expect-error @types/node resolves fetch types via undici-types@7, but we
42+
// import undici@8 directly — Request.headers.keys() iterator types diverge.
43+
// Fix: remove when @types/node ships undici-types@8
44+
input,
45+
{ ...init, dispatcher: mockAgent },
46+
),
4147
});
4248
const command = new GetBillingAccountCommand({
4349
billingAccountId: "1234",

0 commit comments

Comments
 (0)