test(sessions): make unread checks portable

This commit is contained in:
Federico Jaramillo Martinez
2026-07-22 23:36:28 +02:00
parent e70b3d6bb9
commit ced3261651
2 changed files with 19 additions and 15 deletions
@@ -464,7 +464,8 @@ describe("FileSessionUnreadPersistence", () => {
nextCompletionOrder: 1,
sessions: [{ sessionId: "session-1", cwd: "/repo", completionOrder: 1 }],
});
expect((await stat(filePath)).mode & 0o777).toBe(0o600);
// Windows reports synthesized POSIX mode bits and ignores the requested file mode.
if (process.platform !== "win32") expect((await stat(filePath)).mode & 0o777).toBe(0o600);
expect((await readdir(join(root, "state"))).filter((name) => name.endsWith(".tmp"))).toEqual([]);
const reloaded = new SessionUnreadStore({ persistence, createCatalogId: () => "unused-catalog" });