Skip to main content
Glama
tanker327

Prompts MCP Server

by tanker327
mocks.ts1.41 kB
/** * Mock implementations for testing */ import { vi } from 'vitest'; import { PromptInfo } from '../../src/types.js'; /** * Mock PromptCache class */ export class MockPromptCache { private cache = new Map<string, PromptInfo>(); getAllPrompts = vi.fn(() => Array.from(this.cache.values())); getPrompt = vi.fn((name: string) => this.cache.get(name)); isEmpty = vi.fn(() => this.cache.size === 0); size = vi.fn(() => this.cache.size); initializeCache = vi.fn(); initializeFileWatcher = vi.fn(); cleanup = vi.fn(); // Helper methods for testing _setPrompt(name: string, prompt: PromptInfo) { this.cache.set(name, prompt); } _clear() { this.cache.clear(); } } /** * Mock PromptFileOperations class */ export class MockPromptFileOperations { listPrompts = vi.fn(); readPrompt = vi.fn(); savePrompt = vi.fn(); savePromptWithFilename = vi.fn(); deletePrompt = vi.fn(); promptExists = vi.fn(); getPromptInfo = vi.fn(); } /** * Mock chokidar watcher */ export function createMockWatcher() { const watcher = { on: vi.fn().mockReturnThis(), close: vi.fn().mockResolvedValue(undefined), add: vi.fn().mockReturnThis(), unwatch: vi.fn().mockReturnThis() }; return watcher; } /** * Mock process for testing */ export function createMockProcess() { return { on: vi.fn(), exit: vi.fn(), cwd: vi.fn(() => '/test/cwd') }; }

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

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