@toolprint/hypertool-mcp
Version:
HyperTool MCP proxy server for routing requests between clients and multiple underlying MCP servers
77 lines • 2.17 kB
TypeScript
/**
* Lightweight test utilities for HyperTool MCP tests
* Replaces heavyweight TestEnvironment with focused utilities
*/
/**
* Minimal filesystem setup for tests
* Only creates directories that are actually needed
*/
export interface MinimalFsOptions {
baseDir?: string;
createRegistry?: boolean;
createConfig?: boolean;
}
/**
* Creates minimal filesystem structure for tests
* Much lighter than TestEnvironment - only creates what's needed
*/
export declare function createMinimalFs(options?: MinimalFsOptions): {
baseDir: string;
configRoot: string;
cleanup: () => void;
};
/**
* Creates a mock application structure
* Lightweight alternative to TestEnvironment.createMockApp
*/
export declare function createMockApp(appId: string, files: Record<string, string>): void;
/**
* Quick file operations for tests
*/
export declare const testFs: {
write: (path: string, content: string) => void;
read: (path: string) => string;
exists: (path: string) => boolean;
mkdir: (path: string) => void;
reset: () => void;
};
/**
* Mock environment config for tests
* Avoids the heavyweight EnvironmentManager singleton
*/
export declare function createMockEnvConfig(baseDir?: string): {
mode: "test";
baseDir: string;
configRoot: string;
registryPath: string;
backupRoot: string;
cacheRoot: string;
setupScriptsRoot: string;
logsRoot: string;
};
/**
* Platform mock utilities
*/
export declare const platformMock: {
current: NodeJS.Platform;
set: (platform: NodeJS.Platform) => void;
reset: () => void;
};
/**
* Async test wrapper with timeout
* Prevents hanging tests by enforcing timeouts
*/
export declare function withTimeout<T>(fn: () => Promise<T>, timeoutMs?: number): Promise<T>;
/**
* Test scenario helper
* Lightweight alternative to TestEnvironment scenarios
*/
export interface LightweightScenario {
name: string;
setup: () => void | Promise<void>;
teardown?: () => void | Promise<void>;
}
export declare function runScenario(scenario: LightweightScenario): Promise<{
cleanup: () => Promise<void>;
}>;
//# sourceMappingURL=lightweight.d.ts.map