UNPKG

universal-ai-brain

Version:

🧠 UNIVERSAL AI BRAIN 3.3 - The world's most advanced cognitive architecture with 24 specialized systems, MongoDB 8.1 $rankFusion hybrid search, latest Voyage 3.5 embeddings, and framework-agnostic design. Works with Mastra, Vercel AI, LangChain, OpenAI A

28 lines (24 loc) • 608 B
import { MongoMemoryServer } from 'mongodb-memory-server'; import { MongoClient, Db } from 'mongodb'; let mongod: MongoMemoryServer; let client: MongoClient; let db: Db; export async function setupTestDb(): Promise<Db> { mongod = await MongoMemoryServer.create(); const uri = mongod.getUri(); client = new MongoClient(uri); await client.connect(); db = client.db('test_ai_agents'); return db; } export async function teardownTestDb(): Promise<void> { if (client) { await client.close(); } if (mongod) { await mongod.stop(); } } export function getTestDb(): Db { return db; }