Skip to main content
Glama
adapters.jira.spec.ts1.24 kB
import { describe, it, expect, vi, beforeEach } from 'vitest'; import { JiraAdapter } from '../src/adapters/jira.js'; vi.mock('../src/lib/http.js', () => { return { requestJson: vi.fn(), }; }); import { requestJson } from '../src/lib/http.js'; describe('JiraAdapter', () => { const adapter = new JiraAdapter({ url: 'https://jira.example', token: 'user:apitoken' }); beforeEach(() => { vi.clearAllMocks(); }); it('aggregates searchIssues pages up to limit', async () => { (requestJson as any).mockImplementation((url: string) => { if (url.includes('startAt=0')) return Promise.resolve({ status: 200, headers: {}, data: { issues: [{ id: 'A' }, { id: 'B' }] } }); if (url.includes('startAt=2')) return Promise.resolve({ status: 200, headers: {}, data: { issues: [{ id: 'C' }] } }); throw new Error('unexpected url ' + url); }); const res = await adapter.searchIssues('project=TEST', 3); expect(res.issues).toHaveLength(3); }); it('returns issue data on getIssue', async () => { (requestJson as any).mockResolvedValue({ status: 200, headers: {}, data: { key: 'TEST-1' } }); const res = await adapter.getIssue('TEST-1'); expect((res as any).key).toBe('TEST-1'); }); });

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/ashabbir/multi-mcp'

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