Files
novalon-website/test-framework/shared/utils/testing/TestDataVersion.ts
T
张翔 6d92024b63 feat: 修复测试套件问题并添加Woodpecker CI配置
- 修复API测试认证问题:创建全局认证设置,更新Playwright配置
- 优化回归测试稳定性:增加超时时间到15秒,修复定位器
- 创建Woodpecker CI工作流:CI、部署和质量门禁配置
- 添加Jest配置和测试脚本
- 移除登录页面的默认账号密码显示(安全问题修复)
2026-03-09 10:26:02 +08:00

38 lines
1.0 KiB
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]).filter((v): v is string => v !== undefined)));
}
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));
}
}