Skip to main content
Glama
test-data-registry.ts989 B
/** * Test Data Registry for E2E mock ID resolution * * Provides seamless mapping from mock aliases (like "mock-person-123") * to real UUIDs returned by Attio API during E2E test runs. */ class TestDataRegistry { private map = new Map<string, string>(); set(alias: string, realId: string) { this.map.set(alias, realId); } get(alias: string) { return this.map.get(alias); } resolve(alias: string) { return this.map.get(alias); } clear() { this.map.clear(); } size() { return this.map.size; } } export const TestData = new TestDataRegistry(); export const testDataRegistry = new TestDataRegistry(); const UUID_RE = /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/; export function resolveMockId(id: string | undefined | null): string | null { if (!id) return null; if (UUID_RE.test(id)) return id; if (!process.env.E2E_MODE) return id; return testDataRegistry.resolve(id) ?? id; }

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

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