Skip to main content
Glama

MCP Xcode

by Stefan-Nitu
ErrorFormatter.unit.test.ts2.07 kB
import { ErrorFormatter } from '../../formatters/ErrorFormatter.js'; import { BuildIssue } from '../../../features/build/domain/BuildIssue.js'; describe('ErrorFormatter', () => { describe('strategy delegation', () => { it('should delegate error with BuildIssues to BuildIssuesStrategy', () => { const error = { issues: [ BuildIssue.error('Test error') ] }; const result = ErrorFormatter.format(error); // Should return formatted result expect(result).toBeDefined(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); it('should delegate plain Error to DefaultErrorStrategy', () => { const error = new Error('Plain error message'); const result = ErrorFormatter.format(error); // Should return formatted result expect(result).toBeDefined(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); it('should delegate unknown objects to DefaultErrorStrategy', () => { const error = { someField: 'value' }; const result = ErrorFormatter.format(error); // Should return formatted result (DefaultErrorStrategy handles everything) expect(result).toBeDefined(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); it('should handle null by delegating to DefaultErrorStrategy', () => { const result = ErrorFormatter.format(null); // DefaultErrorStrategy should handle null expect(result).toBeDefined(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); it('should handle undefined by delegating to DefaultErrorStrategy', () => { const result = ErrorFormatter.format(undefined); // DefaultErrorStrategy should handle undefined expect(result).toBeDefined(); expect(typeof result).toBe('string'); expect(result.length).toBeGreaterThan(0); }); }); });

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/Stefan-Nitu/mcp-xcode'

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