diff --git a/apps/skills/src/app/[toolName]/route.test.ts b/apps/skills/src/app/[toolName]/route.test.ts new file mode 100644 index 000000000..6c97acf64 --- /dev/null +++ b/apps/skills/src/app/[toolName]/route.test.ts @@ -0,0 +1,20 @@ +import { describe, expect, it, vi } from "vitest"; + +import { HEAD } from "./route"; + +describe("skill-site MCP tool route", () => { + it("does not call MCP tools for HEAD requests", () => { + const previousFetch = globalThis.fetch; + const fetchMock = vi.fn(); + globalThis.fetch = fetchMock; + + try { + const response = HEAD(); + + expect(response.status).toBe(200); + expect(fetchMock).not.toHaveBeenCalled(); + } finally { + globalThis.fetch = previousFetch; + } + }); +});