mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-22 07:44:03 +00:00
test: verify repaired session records
This commit is contained in:
@@ -55,7 +55,11 @@ describe("repairSessionFileIfNeeded", () => {
|
||||
const backupPath = requireBackupPath(result);
|
||||
|
||||
const repaired = await fs.readFile(file, "utf-8");
|
||||
expect(repaired.trim().split("\n")).toHaveLength(2);
|
||||
const repairedLines = repaired
|
||||
.trim()
|
||||
.split("\n")
|
||||
.map((line) => JSON.parse(line));
|
||||
expect(repairedLines).toEqual([header, message]);
|
||||
|
||||
const backup = await fs.readFile(backupPath, "utf-8");
|
||||
expect(backup).toBe(content);
|
||||
@@ -668,7 +672,7 @@ describe("repairSessionFileIfNeeded", () => {
|
||||
|
||||
const after = await fs.readFile(file, "utf-8");
|
||||
const lines = after.trimEnd().split("\n");
|
||||
expect(lines).toHaveLength(2);
|
||||
expect(lines.map((line) => JSON.parse(line))).toEqual([header, message]);
|
||||
});
|
||||
|
||||
it("preserves non-`message` envelope types (e.g. compactionSummary, custom) without role inspection", async () => {
|
||||
|
||||
Reference in New Issue
Block a user