Skip to main content
Glama
portel-dev

NCP - Natural Context Provider

by portel-dev
doctor-command.test.ts2.32 kB
/** * Unit tests for DoctorCommand * Tests system diagnostics and health checks */ import { DoctorCommand, DiagnosticCheck } from '../../src/cli/commands/doctor'; describe('DoctorCommand', () => { describe('diagnose', () => { // These are integration tests that verify diagnose completes // Skipping as they involve CLI output test.skip('should complete without errors', async () => { await DoctorCommand.diagnose(); }); test.skip('should accept optional MCP name parameter', async () => { await DoctorCommand.diagnose('test-mcp'); }); }); describe('DiagnosticCheck interface', () => { test('should have required properties', () => { const check: DiagnosticCheck = { name: 'Test Check', status: 'HEALTHY', message: 'All good', details: ['Detail 1', 'Detail 2'] }; expect(check.name).toBe('Test Check'); expect(check.status).toBe('HEALTHY'); expect(check.message).toBe('All good'); expect(check.details).toHaveLength(2); }); test('should support all status types', () => { const statuses: Array<'HEALTHY' | 'UNHEALTHY' | 'DEGRADED' | 'UNKNOWN'> = [ 'HEALTHY', 'UNHEALTHY', 'DEGRADED', 'UNKNOWN' ]; statuses.forEach(status => { const check: DiagnosticCheck = { name: 'Test', status }; expect(check.status).toBe(status); }); }); test('should allow optional message and details', () => { const checkWithoutMessage: DiagnosticCheck = { name: 'Test', status: 'HEALTHY' }; expect(checkWithoutMessage.message).toBeUndefined(); expect(checkWithoutMessage.details).toBeUndefined(); const checkWithDetails: DiagnosticCheck = { name: 'Test', status: 'HEALTHY', details: [] }; expect(checkWithDetails.details).toEqual([]); }); }); describe('integration with CLI', () => { test('doctor command should be async and return void', () => { // Verify the diagnose method signature expect(typeof DoctorCommand.diagnose).toBe('function'); // Verify it returns a Promise const result = DoctorCommand.diagnose(); expect(result instanceof Promise).toBe(true); }); }); });

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