refactor(*): 稳定期治理 - 收敛核心架构、错误语义并修复跨项目数据竞态

This commit is contained in:
ddCat
2026-09-09 22:02:10 +08:00
parent bacd502f5c
commit b5f3413ded
298 changed files with 12681 additions and 26428 deletions

View File

@@ -0,0 +1,13 @@
import { describe, expect, test } from "bun:test";
import { formatLocalSavedRemotePending } from "@/services/user-data-sync";
describe("本地已保存、云端同步失败的文案", () => {
test("带上原始错误并声明会自动重试", () => {
expect(formatLocalSavedRemotePending("素材已在本地保存", new Error("网络中断"))).toBe("素材已在本地保存,云端同步失败:网络中断。将自动重试。");
});
test("没有 Error.message 时使用未知错误", () => {
expect(formatLocalSavedRemotePending("已在本地还原", "x")).toBe("已在本地还原,云端同步失败:未知错误。将自动重试。");
});
});