4c8714c12d
- Fixed all form tests (20/20 passing) - Fixed all performance tests (35/35 passing) - Fixed all SEO and accessibility tests (30/30 passing) - Enhanced test framework with custom reporting - Added performance baseline tracking - Improved test reliability and error handling
38 lines
996 B
TypeScript
38 lines
996 B
TypeScript
export class TestDataVersion {
|
|
private versions: Map<string, string> = new Map();
|
|
private currentVersion: string = '1.0.0';
|
|
|
|
setCurrentVersion(version: string): void {
|
|
this.currentVersion = version;
|
|
}
|
|
|
|
getCurrentVersion(): string {
|
|
return this.currentVersion;
|
|
}
|
|
|
|
saveVersion(key: string, data: string): void {
|
|
this.versions.set(`${this.currentVersion}-${key}`, data);
|
|
}
|
|
|
|
getVersion(key: string): string | undefined {
|
|
return this.versions.get(`${this.currentVersion}-${key}`);
|
|
}
|
|
|
|
listVersions(): string[] {
|
|
return Array.from(new Set(Array.from(this.versions.keys()).map(k => k.split('-')[0])));
|
|
}
|
|
|
|
export(): string {
|
|
return JSON.stringify({
|
|
currentVersion: this.currentVersion,
|
|
versions: Object.fromEntries(this.versions)
|
|
}, null, 2);
|
|
}
|
|
|
|
import(json: string): void {
|
|
const imported = JSON.parse(json);
|
|
this.currentVersion = imported.currentVersion;
|
|
this.versions = new Map(Object.entries(imported.versions));
|
|
}
|
|
}
|