From 3271ff1d6e26d6799250eb6b02297ec4da6fc0f8 Mon Sep 17 00:00:00 2001 From: Friederike Seiler Date: Mon, 12 Jan 2026 01:08:52 +0100 Subject: [PATCH] Tests: clean chutes fetch spies --- src/agents/auth-profiles.chutes.test.ts | 4 ++-- src/commands/auth-choice.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/agents/auth-profiles.chutes.test.ts b/src/agents/auth-profiles.chutes.test.ts index f15d7fab5..6d48b2b43 100644 --- a/src/agents/auth-profiles.chutes.test.ts +++ b/src/agents/auth-profiles.chutes.test.ts @@ -73,8 +73,8 @@ describe("auth-profiles (chutes)", () => { }; await fs.writeFile(authProfilePath, `${JSON.stringify(store)}\n`); - const fetchSpy = vi.fn(async (input: RequestInfo | URL) => { - const url = String(input); + const fetchSpy = vi.fn(async (input: string | URL) => { + const url = typeof input === "string" ? input : input.toString(); if (url !== CHUTES_TOKEN_ENDPOINT) return new Response("not found", { status: 404 }); return new Response( diff --git a/src/commands/auth-choice.test.ts b/src/commands/auth-choice.test.ts index 5705e75b9..14da2bef6 100644 --- a/src/commands/auth-choice.test.ts +++ b/src/commands/auth-choice.test.ts @@ -359,8 +359,8 @@ describe("applyAuthChoice", () => { process.env.SSH_TTY = "1"; process.env.CHUTES_CLIENT_ID = "cid_test"; - const fetchSpy = vi.fn(async (input: RequestInfo | URL) => { - const url = String(input); + const fetchSpy = vi.fn(async (input: string | URL) => { + const url = typeof input === "string" ? input : input.toString(); if (url === "https://api.chutes.ai/idp/token") { return new Response( JSON.stringify({