/** * Shared test utilities for consistent test patterns across the codebase. * * These utilities reduce code duplication and provide a standardized approach * to common test operations like ANSI stripping, file existence checks, and * temp directory management. */ /** * Strip ANSI escape codes from a string for plain text comparison. * * Note: This test utility uses a simple string parameter rather than named args * for ergonomics, since it's called frequently in test assertions. * * @param str - The string containing ANSI codes * * @returns The string with ANSI codes removed */ export declare const stripAnsi: (str: string) => string; /** * Check if a file or directory exists at the given path. * * @param args - The arguments object * @param args.filePath - The path to check * * @returns Promise resolving to true if the path exists, false otherwise */ export declare const pathExists: (args: { filePath: string; }) => Promise; /** * Context object returned by createTempTestContext for managing test directories. */ export type TempTestContext = { /** The root temporary directory for this test */ tempDir: string; /** The agent config directory within tempDir (e.g. .claude/) */ agentDir: string; /** Clean up the temporary directory after the test */ cleanup: () => Promise; }; /** * Create a temporary test context with standardized directory structure. * * @param args - The arguments object * @param args.prefix - Prefix for the temp directory name (e.g., "profiles-test") * @param args.agentDirName - Override the agent config directory name (defaults to ".claude") * * @returns Promise resolving to a TempTestContext with tempDir, agentDir, and cleanup function * * @example * ```typescript * let ctx: TempTestContext; * * beforeEach(async () => { * ctx = await createTempTestContext({ prefix: "my-test" }); * }); * * afterEach(async () => { * await ctx.cleanup(); * }); * ``` */ export declare const createTempTestContext: (args: { prefix: string; agentDirName?: string | null; }) => Promise; /** * Context object with HOME isolation for integration tests. * Extends TempTestContext with additional fields for HOME directory isolation. */ export type IsolatedTestContext = TempTestContext & { /** The isolated home directory for this test */ homeDir: string; /** The .nori directory within homeDir */ noriDir: string; /** Original NORI_GLOBAL_CONFIG value to restore */ originalGlobalConfig: string | undefined; }; /** * Create an isolated test context with HOME directory isolation. * Use this for integration tests that need complete isolation from the global * test setup (e.g., tests that need their own config state). * * @param args - The arguments object * @param args.prefix - Prefix for the temp directory name * * @returns Promise resolving to IsolatedTestContext * * @example * ```typescript * let ctx: IsolatedTestContext; * * beforeEach(async () => { * ctx = await createIsolatedTestContext({ prefix: "config-test" }); * }); * * afterEach(async () => { * await ctx.cleanup(); * }); * ``` */ export declare const createIsolatedTestContext: (args: { prefix: string; }) => Promise; //# sourceMappingURL=index.d.ts.map