UNPKG

@toolprint/hypertool-mcp

Version:

HyperTool MCP proxy server for routing requests between clients and multiple underlying MCP servers

31 lines • 1.08 kB
/** * Test environment detection and process control utilities * Centralized utility to prevent process.exit calls during tests */ /** * Detect if we're running in a test environment */ export declare function isTestEnvironment(): boolean; /** * Safe process exit that respects test environment * Only exits in production, throws in tests */ export declare function safeProcessExit(code?: number, message?: string): never; /** * Exception thrown when code attempts to exit in test environment */ export declare class TestEnvironmentExitError extends Error { readonly exitCode: number; readonly originalMessage?: string; constructor(exitCode?: number, originalMessage?: string); } /** * Safe wrapper for operations that might exit * Returns result or throws in test environment */ export declare function safeOperationWrapper<T>(operation: () => Promise<T> | T, errorMessage?: string): Promise<T>; /** * Check if we're in test mode for conditional behavior */ export declare function isInTestMode(): boolean; //# sourceMappingURL=testEnvironment.d.ts.map