@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
27 lines (26 loc) • 846 B
TypeScript
/**
* Schema mocking utilities for service tests
* Provides simplified mocks for @directus/schema module used in service testing
*/
/**
* Creates a standard schema inspector mock for service tests
* This matches the pattern used across all service test files
*
* @returns Mock module object for vi.mock()
*
* @example
* ```typescript
* // Standard usage
* vi.mock('@directus/schema', () => mockSchema());
*
* // To dynamically change inspector behavior during tests, import and mock directly:
* import { createInspector } from '@directus/schema';
* vi.mocked(createInspector).mockReturnValue({
* tableInfo: vi.fn().mockResolvedValue([{ name: 'custom_table' }]),
* // ... other custom behaviors
* });
* ```
*/
export declare function mockSchema(): {
createInspector: import("vitest").Mock<(...args: any[]) => any>;
};