mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-19 21:00:40 +08:00
Test skill HEAD route
This commit is contained in:
parent
647dd6042f
commit
19705a3970
20
apps/skills/src/app/[toolName]/route.test.ts
Normal file
20
apps/skills/src/app/[toolName]/route.test.ts
Normal file
@ -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;
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user