Skip to main content
Glama
setup.ts1.32 kB
/** * Vitest Setup File * * Mocks external dependencies that aren't properly resolved in the test environment. */ import { vi } from 'vitest'; // Mock @freshbooks/api query builders // These are classes exported from the SDK that need to be mocked for tests vi.mock('@freshbooks/api', () => ({ // PaginationQueryBuilder mock PaginationQueryBuilder: vi.fn().mockImplementation(() => ({ page: vi.fn().mockReturnThis(), perPage: vi.fn().mockReturnThis(), })), // SearchQueryBuilder mock SearchQueryBuilder: vi.fn().mockImplementation(() => ({ equals: vi.fn().mockReturnThis(), boolean: vi.fn().mockReturnThis(), like: vi.fn().mockReturnThis(), in: vi.fn().mockReturnThis(), between: vi.fn().mockReturnThis(), datetime: vi.fn().mockReturnThis(), })), // IncludesQueryBuilder mock IncludesQueryBuilder: vi.fn().mockImplementation(() => ({ includes: vi.fn().mockReturnThis(), })), // SortQueryBuilder mock (in case it's used) SortQueryBuilder: vi.fn().mockImplementation(() => ({ ascending: vi.fn().mockReturnThis(), descending: vi.fn().mockReturnThis(), })), // Client mock (in case direct Client import is used) Client: vi.fn().mockImplementation(() => ({ timeEntries: {}, projects: {}, services: {}, tasks: {}, })), }));

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/Good-Samaritan-Software-LLC/freshbooks-mcp'

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