Skip to main content
Glama
mockingFetch.test.ts545 B
import { expect, test, vi } from "vitest"; import { api } from "./_generated/api"; import schema from "./schema"; import { convexTest } from "convex-test"; test("ai", async () => { const t = convexTest(schema, modules); vi.stubGlobal( "fetch", vi.fn(async () => ({ text: async () => "I am the overlord" }) as Response), ); const reply = await t.action(api.messages.sendAIMessage, { prompt: "hello" }); expect(reply).toEqual("I am the overlord"); vi.unstubAllGlobals(); }); const modules = import.meta.glob("./**/*.ts");

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/get-convex/convex-backend'

If you have feedback or need assistance with the MCP directory API, please join our Discord server