Skip to main content
Glama
global-setup.tsโ€ข2.08 kB
/** * Global test setup for Vibe Task Manager tests * Runs once before all tests start */ import { resolve } from 'path'; import { mkdir } from 'fs/promises'; import logger from '../../../../logger.js'; import { initializeTestServices } from '../setup.js'; import { autoRegisterKnownSingletons } from './singleton-reset-manager.js'; import { EventEmitter } from 'events'; export default async function globalSetup() { try { console.log('๐Ÿš€ Starting global test setup...'); // Set up test environment process.env.NODE_ENV = 'test'; process.env.LOG_LEVEL = 'warn'; // Reduce log noise during tests // Create test directories const testDataDir = resolve(process.cwd(), 'src/tools/vibe-task-manager/__tests__/data'); const testOutputDir = resolve(process.cwd(), 'src/tools/vibe-task-manager/__tests__/output'); await mkdir(testDataDir, { recursive: true }); await mkdir(testOutputDir, { recursive: true }); // Initialize test services initializeTestServices(); // Auto-register known singletons for reset await autoRegisterKnownSingletons(); // Log initial memory usage const initialMemory = process.memoryUsage(); console.log(`๐Ÿ“Š Initial memory usage: ${Math.round(initialMemory.heapUsed / 1024 / 1024)} MB`); // Set up global error handlers for tests process.on('unhandledRejection', (reason, promise) => { logger.error({ reason, promise }, 'Unhandled rejection in tests'); }); process.on('uncaughtException', (error) => { logger.error({ err: error }, 'Uncaught exception in tests'); }); // Configure EventEmitter defaults for tests EventEmitter.defaultMaxListeners = 20; // Increase default for tests console.log('โœ… Global test setup completed'); // Return a teardown function as required by vitest return async () => { console.log('๐Ÿงน Running global teardown from setup...'); // This will be called by vitest at the end }; } catch (error) { console.error('โŒ Global test setup failed:', error); throw error; } }

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/freshtechbro/vibe-coder-mcp'

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