UNPKG

markmv

Version:

TypeScript CLI for markdown file operations with intelligent link refactoring

58 lines 2.7 kB
/** Cross-platform test utilities for handling filesystem differences */ export interface PlatformInfo { isWindows: boolean; isMacOS: boolean; isLinux: boolean; pathSeparator: string; caseSensitive: boolean; supportsSymlinks: boolean; } /** Get current platform information */ export declare function getPlatformInfo(): PlatformInfo; /** Normalize path for the current platform */ export declare function normalizePath(path: string): string; /** Create a path using the appropriate separator for the current platform */ export declare function createPath(...segments: string[]): string; /** Convert path separators to the current platform */ export declare function convertPathSeparators(path: string): string; /** Test if two filenames would conflict on the current filesystem */ export declare function wouldFilenamesConflict(filename1: string, filename2: string): boolean; /** Skip test if the current platform doesn't support the required feature */ export declare function skipIfUnsupported(feature: 'symlinks' | 'case-sensitivity'): boolean; /** Check if a test should be skipped based on platform capabilities */ export declare function shouldSkipTest(requirement: 'symlinks' | 'case-sensitivity' | 'windows' | 'unix'): { skip: boolean; reason: string; }; /** * Create test helper that conditionally runs based on platform capabilities Note: This function * expects to be called within a test context where `test` is available */ export declare function createConditionalTest(testFn: { (name: string, testCallback: () => void | Promise<void>): void; skip: (name: string, testCallback: () => void | Promise<void>) => void; }): (name: string, requirement: "symlinks" | "case-sensitivity" | "windows" | "unix", testCallback: () => void | Promise<void>) => void; /** Check if a file exists and is accessible */ export declare function fileExists(filePath: string): boolean; /** Check if a path is a symbolic link */ export declare function isSymbolicLink(filePath: string): boolean; /** Get OS-specific temporary directory patterns */ export declare function getTempDirPatterns(): string[]; /** Platform-specific test data for path testing */ export declare const PLATFORM_TEST_PATHS: { windows: { absolute: string[]; relative: string[]; invalid: string[]; traversal: string[]; }; unix: { absolute: string[]; relative: string[]; invalid: string[]; traversal: string[]; }; }; /** Get platform-appropriate test paths */ export declare function getTestPaths(): typeof PLATFORM_TEST_PATHS.windows | typeof PLATFORM_TEST_PATHS.unix; //# sourceMappingURL=test-helpers.d.ts.map