Skip to main content
Glama
index.test.ts2.13 kB
import { describe, it, expect, vi, beforeEach } from 'vitest'; // Arrange: Mock client classes vi.mock('../../src/clients/claude.js', () => ({ ClaudeClientManager: vi.fn().mockImplementation(() => ({ getConfigPath: vi.fn(), configure: vi.fn(), })), })); vi.mock('../../src/clients/cursor.js', () => ({ CursorClientManager: vi.fn().mockImplementation(() => ({ getConfigPath: vi.fn(), configure: vi.fn(), })), })); vi.mock('../../src/clients/windsurf.js', () => ({ WindsurfClientManager: vi.fn().mockImplementation(() => ({ getConfigPath: vi.fn(), configure: vi.fn(), })), })); vi.mock('../../src/clients/vscode.js', () => ({ VSCodeClientManager: vi.fn().mockImplementation(() => ({ getConfigPath: vi.fn(), configure: vi.fn(), })), })); // Act: Import the module under test after mocking dependencies import * as clientsIndex from '../../src/clients/index.js'; describe('Client Module Index', () => { beforeEach(() => { vi.clearAllMocks(); }); it('should export a clients namespace object with client manager instances', () => { // Assert: Verify that the clients object is defined and contains expected keys expect(clientsIndex.clients).toBeDefined(); expect(clientsIndex.clients).toHaveProperty('claude'); expect(clientsIndex.clients).toHaveProperty('cursor'); expect(clientsIndex.clients).toHaveProperty('windsurf'); expect(clientsIndex.clients).toHaveProperty('vscode'); // Assert: Verify that each client manager instance has the expected methods expect(clientsIndex.clients.claude).toHaveProperty('getConfigPath'); expect(clientsIndex.clients.claude).toHaveProperty('configure'); expect(clientsIndex.clients.cursor).toHaveProperty('getConfigPath'); expect(clientsIndex.clients.cursor).toHaveProperty('configure'); expect(clientsIndex.clients.windsurf).toHaveProperty('getConfigPath'); expect(clientsIndex.clients.windsurf).toHaveProperty('configure'); expect(clientsIndex.clients.vscode).toHaveProperty('getConfigPath'); expect(clientsIndex.clients.vscode).toHaveProperty('configure'); }); });

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

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