Skip to main content
Glama
mockClient.ts2.49 kB
import { vi } from 'vitest'; const { mockConceptCreate, mockConceptCreateWithId, mockConceptGet, mockConceptGetMany, mockConceptGetDescendants, mockConceptGetAncestors, mockConceptGetTotal, mockConceptDelete, mockConceptUpdatePut, mockCreateClient, } = vi.hoisted(() => { const mockConceptCreate = vi.fn(); const mockConceptCreateWithId = vi.fn(); const mockConceptGet = vi.fn(); const mockConceptGetMany = vi.fn(); const mockConceptGetDescendants = vi.fn(); const mockConceptGetAncestors = vi.fn(); const mockConceptGetTotal = vi.fn(); const mockConceptDelete = vi.fn(); const mockConceptUpdatePut = vi.fn(); const mockCreateClient = vi.fn(() => ({ concept: { create: mockConceptCreate, createWithId: mockConceptCreateWithId, get: mockConceptGet, getMany: mockConceptGetMany, getDescendants: mockConceptGetDescendants, getAncestors: mockConceptGetAncestors, getTotal: mockConceptGetTotal, delete: mockConceptDelete, updatePut: mockConceptUpdatePut, }, })); return { mockConceptCreate, mockConceptCreateWithId, mockConceptGet, mockConceptGetMany, mockConceptGetDescendants, mockConceptGetAncestors, mockConceptGetTotal, mockConceptDelete, mockConceptUpdatePut, mockCreateClient, }; }); vi.mock('contentful-management', () => { return { default: { createClient: mockCreateClient, }, createClient: mockCreateClient, }; }); export { mockConceptCreate, mockConceptCreateWithId, mockConceptGet, mockConceptGetMany, mockConceptGetDescendants, mockConceptGetAncestors, mockConceptGetTotal, mockConceptDelete, mockConceptUpdatePut, mockCreateClient, }; export const testConcept = { sys: { type: 'TaxonomyConcept', id: 'test-concept-id', version: 1, createdAt: '2023-01-01T00:00:00Z', updatedAt: '2023-01-01T00:00:00Z', createdBy: { sys: { type: 'Link', linkType: 'User', id: 'user-id', }, }, updatedBy: { sys: { type: 'Link', linkType: 'User', id: 'user-id', }, }, }, prefLabel: { 'en-US': 'Test Concept', }, uri: null, altLabels: {}, hiddenLabels: {}, definition: null, editorialNote: null, historyNote: null, example: null, note: null, scopeNote: null, notations: [], broader: [], related: [], }; export const mockArgs = { organizationId: 'test-org-id', };

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

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