test: check migration backup filenames · openclaw/openclaw@77e3f2b
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -141,11 +141,14 @@ describe("copyMigrationFileItem", () => {
|
141 | 141 | expect(second.status).toBe("migrated"); |
142 | 142 | const firstBackup = first.details?.backupPath; |
143 | 143 | const secondBackup = second.details?.backupPath; |
144 | | -expect(firstBackup).toEqual(expect.stringContaining("AGENTS.md")); |
145 | | -expect(secondBackup).toEqual(expect.stringContaining("AGENTS.md")); |
| 144 | +if (typeof firstBackup !== "string" || typeof secondBackup !== "string") { |
| 145 | +throw new Error("expected both migration results to include backup paths"); |
| 146 | +} |
| 147 | +expect(path.basename(firstBackup)).toBe("AGENTS.md"); |
| 148 | +expect(path.basename(secondBackup)).toBe("AGENTS.md"); |
146 | 149 | expect(firstBackup).not.toBe(secondBackup); |
147 | | -await expect(fs.readFile(firstBackup as string, "utf8")).resolves.toBe("old one"); |
148 | | -await expect(fs.readFile(secondBackup as string, "utf8")).resolves.toBe("old two"); |
| 150 | +await expect(fs.readFile(firstBackup, "utf8")).resolves.toBe("old one"); |
| 151 | +await expect(fs.readFile(secondBackup, "utf8")).resolves.toBe("old two"); |
149 | 152 | }); |
150 | 153 | }); |
151 | 154 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。