Skip to main content
Glama
database-index.test.ts586 B
import { getDb } from "../database/index"; import { drizzle } from "drizzle-orm/d1"; // Mock drizzle jest.mock("drizzle-orm/d1", () => ({ drizzle: jest.fn(), })); describe("Database Index Tests", () => { test("should create database connection", () => { const mockD1 = {} as D1Database; const mockDrizzleInstance = {}; (drizzle as jest.Mock).mockReturnValue(mockDrizzleInstance); const db = getDb(mockD1); expect(drizzle).toHaveBeenCalledWith( mockD1, expect.objectContaining({ schema: expect.any(Object) }), ); expect(db).toBe(mockDrizzleInstance); }); });

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/duyet/duyet-mcp-server'

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