Skip to content

Commit 19a84ea

Browse files
committed
test(memory): deduplicate archive transcript fixtures
1 parent 190d8c2 commit 19a84ea

1 file changed

Lines changed: 4 additions & 14 deletions

File tree

‎packages/memory-host-sdk/src/host/session-files.test.ts‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,28 +296,18 @@ describe("listSessionTranscriptCorpusEntriesForAgent", () => {
296296
updateMode: "none",
297297
},
298298
);
299+
const archiveMessage = (content: string) =>
300+
JSON.stringify({ type: "message", message: { role: "user", content } });
299301
const archivePath = path.join(
300302
sessionsDir,
301303
`${sessionId}.jsonl.deleted.2026-06-25T12-01-00.000Z`,
302304
);
303-
fsSync.writeFileSync(
304-
archivePath,
305-
JSON.stringify({
306-
type: "message",
307-
message: { role: "user", content: "Archived JSONL transcript text" },
308-
}),
309-
);
305+
fsSync.writeFileSync(archivePath, archiveMessage("Archived JSONL transcript text"));
310306
const resetArchivePath = path.join(
311307
sessionsDir,
312308
`${sessionId}.jsonl.reset.2026-06-25T12-02-00.000Z`,
313309
);
314-
fsSync.writeFileSync(
315-
resetArchivePath,
316-
JSON.stringify({
317-
type: "message",
318-
message: { role: "user", content: "Retained pre-reset conversation fact" },
319-
}),
320-
);
310+
fsSync.writeFileSync(resetArchivePath, archiveMessage("Retained pre-reset conversation fact"));
321311

322312
expect(fsSync.existsSync(path.join(sessionsDir, `${sessionId}.jsonl`))).toBe(false);
323313
const entries = await listSessionTranscriptCorpusEntriesForAgent("main");

0 commit comments

Comments
 (0)