UNPKG

@directus/api

Version:

Directus is a real-time API and App dashboard for managing SQL database content

29 lines (28 loc) 919 B
/** * FilesService mocking utilities for service tests * Provides simplified mocks for src/services/files module used in service testing */ /** * Creates a standard FilesService mock for service tests * This matches the pattern used in CollectionsService tests * * @returns Mock module object for vi.mock() * * @example * ```typescript * // Standard usage * vi.mock('./files.js', async () => { * const { mockFilesService } = await import('../test-utils/services/files-service.js'); * return mockFilesService(); * }); * * // To dynamically change FilesService behavior during tests: * import { FilesService } from './files.js'; * vi.spyOn(FilesService.prototype, 'addColumnToTable').mockImplementation((table, collection, field) => { * // custom implementation * }); * ``` */ export declare function mockFilesService(): { FilesService: import("vitest").Mock<(...args: any[]) => any>; };