Skip to main content
Glama
jest.setup.ts851 B
import { config } from 'dotenv'; import { setupTestDatabase, teardownTestDatabase, getTestPrismaClient } from './utils/testDb'; // Load environment variables config(); // Set test environment process.env.NODE_ENV = 'test'; const prisma = getTestPrismaClient(); // Set up database before all tests beforeAll(async () => { await setupTestDatabase(); }); // Clean tables before each test beforeEach(async () => { const tableNames = await prisma.$queryRaw<Array<{ tablename: string }>>` SELECT tablename FROM pg_tables WHERE schemaname='public' `; for (const { tablename } of tableNames) { if (tablename !== '_prisma_migrations') { await prisma.$executeRawUnsafe(`TRUNCATE TABLE "public"."${tablename}" CASCADE;`); } } }); // Clean up after all tests afterAll(async () => { await teardownTestDatabase(); });

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/visheshd/docmcp'

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