/** * Test Environment Mock Factory * * This module serves as a centralized export point for all mock creation * utilities used in test environments. It provides a unified interface * for creating spies, function mocks, and HTTP client mocks. * * Design philosophy: * - Centralized access to all mock creation utilities * - Backward compatibility with existing test patterns * - Clear separation of concerns between different mock types * - Consistent API across all mock creation functions * * Export organization: * - Spy utilities: For attaching spies to existing objects * - Function mocks: For creating mock functions with logging * - HTTP mocks: For creating network request mocks * * Usage patterns: * - Import specific utilities: import { createAxiosMock } from 'qtests/utils/testEnv/mockFactory' * - Import all utilities: import * as mockFactory from 'qtests/utils/testEnv/mockFactory' */ /** * Spy attachment utilities for existing objects * These functions attach spies to object methods while preserving * original functionality and providing call tracking. */ export { attachMockSpies, // Attach multiple spies to an object makeLoggedMock } from './spyAttacher.js'; /** * Function mocking utilities for standalone mock creation * These functions create independent mock functions with configurable * behavior and return values. */ export { createScheduleMock, // Create scheduling-related function mocks createQerrorsMock } from './functionMocks.js'; /** * HTTP client mocking utilities for network isolation * These functions create mocks for HTTP clients and related * networking functionality to prevent actual network calls. */ export { createAxiosMock, // Create axios HTTP client mocks resetMocks } from './axiosMocks.js'; /** * Service mocking utilities for third-party dependencies * These functions create mocks for services that qtests doesn't * automatically stub, enabling isolated testing without external calls. */ export { createMockWhois, // Create whois-json module mocks createMockOpenAI, // Create OpenAI SDK mocks createMockNodemailer, // Create nodemailer module mocks DEFAULT_MOCK_DATA, // Default mock data for consistent testing setupManualMocks, // Bulk ESM mock setup for all services clearAllMocks, // Clear jest.clearAllMocks + any passed mocks type MockWhoisResponse, type MockOpenAIResponse, type MockNodemailerTransport, type MockNodemailerResult, type MockWhoisResult, type MockOpenAIResult, type SetupManualMocksResult } from './serviceMocks.js'; /** * Test mock factory for ML/AI dependencies and configuration * Provides singleton pattern for consistent mock state across tests */ export { TestMockFactory, // Class-based mock factory factory, // Singleton factory instance createTestMocks, // Convenience function to create all mocks setupTestEnvironment, // Quick setup for common use case DEFAULT_TEST_CONFIG, // Default test configuration constants type TestConfig } from './testMockFactory.js'; //# sourceMappingURL=mockFactory.d.ts.map