Skip to main content
Glama
portel-dev

NCP - Natural Context Provider

by portel-dev
setup.ts1.76 kB
/** * Test setup for NCP-OSS * Configures global test environment */ /// <reference types="jest" /> // Extend Jest timeout for integration tests if (typeof jest !== 'undefined') { jest.setTimeout(30000); // Mock console methods for cleaner test output const originalConsole = { ...console }; beforeEach(() => { // Suppress console.log in tests unless NODE_ENV=test-verbose if (process.env.NODE_ENV !== 'test-verbose') { jest.spyOn(console, 'log').mockImplementation(() => {}); jest.spyOn(console, 'info').mockImplementation(() => {}); } }); afterEach(() => { // Restore console methods if (process.env.NODE_ENV !== 'test-verbose') { const logMock = console.log as jest.Mock; const infoMock = console.info as jest.Mock; if (logMock && typeof logMock.mockRestore === 'function') { logMock.mockRestore(); } if (infoMock && typeof infoMock.mockRestore === 'function') { infoMock.mockRestore(); } } }); // Clean up after each test afterEach(async () => { // Clear all timers jest.clearAllTimers(); jest.clearAllMocks(); // Force garbage collection if available if (global.gc) { global.gc(); } }); // Global cleanup after all tests afterAll(async () => { // Clear all timers jest.clearAllTimers(); jest.clearAllMocks(); // Force close any open handles if (process.stdout && typeof process.stdout.destroy === 'function') { // Don't actually destroy stdout, just ensure it's flushed } // Force garbage collection if available if (global.gc) { global.gc(); } // Give a small delay for cleanup await new Promise(resolve => setTimeout(resolve, 50)); }); }

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/portel-dev/ncp'

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