/** * Integration Test Helper with HTTP Utilities and Server Readiness * * Provides utilities for integration tests that make actual HTTP requests: * - Pre-configured axios instance with timing interceptors * - HTTP request wrapper with retry logic * - Server readiness checking * - Test data cleanup utilities */ import { AxiosInstance, AxiosResponse } from 'axios'; export interface RequestOptions { retries?: number; retryDelay?: number; expectedStatus?: number[]; timeout?: number; headers?: Record; } export interface TimedAxiosResponse extends AxiosResponse { duration?: number; } /** * Create an axios instance with request/response timing interceptors */ export declare function createTimedAxios(config?: { timeout?: number; validateStatus?: (status: number) => boolean; }): AxiosInstance; declare const testAxios: AxiosInstance; /** * HTTP request wrapper with retry logic and status validation * Uses our existing EnhancedErrorHandler for retry logic */ export declare function makeRequest(method: string, url: string, data?: any, options?: RequestOptions): Promise>; /** * Wait for a server to be ready by polling its health endpoint */ export declare function waitForServer(baseUrl: string, options?: { timeout?: number; healthPath?: string; pollInterval?: number; }): Promise; /** * Wait for a port to be listening */ export declare function waitForPort(port: number, options?: { timeout?: number; host?: string; pollInterval?: number; }): Promise; /** * Clean up global test data with error handling */ export declare function cleanupTestData(): void; /** * Initialize global test data structure */ export declare function initializeTestData(): void; /** * Get next counter value for generating unique test data */ export declare function getNextCounter(type: 'user' | 'rule' | 'template' | 'snooze'): number; export { testAxios }; declare const _default: { createTimedAxios: typeof createTimedAxios; makeRequest: typeof makeRequest; waitForServer: typeof waitForServer; waitForPort: typeof waitForPort; cleanupTestData: typeof cleanupTestData; initializeTestData: typeof initializeTestData; getNextCounter: typeof getNextCounter; testAxios: AxiosInstance; }; export default _default; //# sourceMappingURL=integrationTestHelper.d.ts.map