From 54a04958b7e8e57a7de75a77f3c5ed36b1f1ecf9 Mon Sep 17 00:00:00 2001 From: Silo Server Developer Date: Tue, 2 Jun 2026 20:28:39 +0200 Subject: [PATCH] fix(web): vitest 4 compatible fetch spy in recipes.test (unblocks build after vitest 4.1.0 bump) Co-Authored-By: Claude Opus 4.8 (1M context) --- web/src/lib/recipes.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/lib/recipes.test.ts b/web/src/lib/recipes.test.ts index c997248b..9264fb95 100644 --- a/web/src/lib/recipes.test.ts +++ b/web/src/lib/recipes.test.ts @@ -2,12 +2,12 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import { fetchRecipeCatalog, fetchCandidates, previewSection } from "./recipes"; beforeEach(() => { - vi.spyOn(global, "fetch" as never).mockReset(); + vi.spyOn(globalThis, "fetch").mockReset(); }); describe("recipes API client", () => { it("fetchRecipeCatalog returns categories", async () => { - vi.spyOn(global, "fetch" as never).mockResolvedValue({ + vi.spyOn(globalThis, "fetch").mockResolvedValue({ ok: true, status: 200, text: async () => @@ -19,7 +19,7 @@ describe("recipes API client", () => { }); it("fetchCandidates returns candidate list", async () => { - vi.spyOn(global, "fetch" as never).mockResolvedValue({ + vi.spyOn(globalThis, "fetch").mockResolvedValue({ ok: true, status: 200, text: async () => @@ -33,7 +33,7 @@ describe("recipes API client", () => { }); it("previewSection POSTs body and returns items", async () => { - vi.spyOn(global, "fetch" as never).mockResolvedValue({ + vi.spyOn(globalThis, "fetch").mockResolvedValue({ ok: true, status: 200, text: async () => JSON.stringify({ items: [{ content_id: "x" }], total_count: 1 }),