Skip to main content
Glama
monitor.test.ts1.66 kB
import { describe, it, expect } from 'vitest'; import { readLogs } from '../../src/monitor/logs'; describe('Monitor Module E2E', () => { describe('Log Reading', () => { it('should handle system log source', async () => { // System logs should be available on macOS const logs = await readLogs({ source: 'system', lines: 5 }); expect(logs).toBeDefined(); expect(typeof logs).toBe('string'); }, 10000); it('should read logs with default line count', async () => { const logs = await readLogs({ source: 'system' }); expect(logs).toBeDefined(); }); }); describe('Log Filtering', () => { it('should filter logs with regex pattern', async () => { const logs = await readLogs({ source: 'system', lines: 50, filter: 'error|warn' }); expect(logs).toBeDefined(); }); it('should filter logs with keyword search', async () => { const logs = await readLogs({ source: 'system', lines: 50, filter: 'tauri' }); expect(logs).toBeDefined(); }); it('should filter logs by timestamp', async () => { const since = new Date(Date.now() - 60000).toISOString(); // Last minute const logs = await readLogs({ source: 'system', lines: 50, since }); expect(logs).toBeDefined(); }); it('should combine filters (regex + timestamp)', async () => { const since = new Date(Date.now() - 300000).toISOString(); // Last 5 minutes const logs = await readLogs({ source: 'system', lines: 50, filter: 'info', since }); expect(logs).toBeDefined(); }); }); });

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

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