@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
86 lines • 2.09 kB
TypeScript
/**
* @fileoverview Snapshot Testing Utilities
*/
import type { GeneratedCode, SnapshotTestOptions, TestResult } from './types.js';
/**
* Utilities for snapshot testing generated code
*/
export declare class SnapshotTester {
private snapshotDir;
private updateSnapshots;
constructor(snapshotDir?: string, updateSnapshots?: boolean);
/**
* Test generated code against snapshot
*/
testSnapshot(testName: string, generatedCode: GeneratedCode, options: SnapshotTestOptions): Promise<TestResult>;
/**
* Normalize generated code for consistent snapshots
*/
private normalizeGeneratedCode;
/**
* Normalize code content
*/
private normalizeCode;
/**
* Normalize HTML content
*/
private normalizeHTML;
/**
* Get snapshot file path
*/
private getSnapshotPath;
/**
* Create snapshot file
*/
private createSnapshot;
/**
* Create snapshot file content with metadata
*/
private createSnapshotContent;
/**
* Load existing snapshot
*/
private loadSnapshot;
/**
* Compare two snapshots
*/
private compareSnapshots;
/**
* Test multiple snapshots
*/
testMultipleSnapshots(tests: Array<{
name: string;
generatedCode: GeneratedCode;
options?: Partial<SnapshotTestOptions>;
}>): Promise<TestResult[]>;
/**
* Clean up old snapshots
*/
cleanupSnapshots(activeTestNames: string[]): Promise<void>;
/**
* Get snapshot statistics
*/
getSnapshotStats(): Promise<{
total: number;
passed: number;
failed: number;
obsolete: number;
}>;
/**
* Set update snapshots mode
*/
setUpdateSnapshots(update: boolean): void;
/**
* Get update snapshots mode
*/
getUpdateSnapshots(): boolean;
/**
* Set snapshot directory
*/
setSnapshotDir(dir: string): void;
/**
* Get snapshot directory
*/
getSnapshotDir(): string;
}
//# sourceMappingURL=snapshot-tester.d.ts.map