diff --git a/src/media/store.test.ts b/src/media/store.test.ts index 20448cfe7..19021ce0c 100644 --- a/src/media/store.test.ts +++ b/src/media/store.test.ts @@ -26,7 +26,10 @@ describe("media store", () => { it("creates and returns media directory", async () => { const dir = await store.ensureMediaDir(); - expect(dir).toContain("clawdbot-home-test"); + const normalized = path.normalize(dir); + expect(normalized).toContain( + `${path.sep}.clawdbot${path.sep}media`, + ); const stat = await fs.stat(dir); expect(stat.isDirectory()).toBe(true); }); diff --git a/src/web/logout.test.ts b/src/web/logout.test.ts index 83f88e287..3a7aea06a 100644 --- a/src/web/logout.test.ts +++ b/src/web/logout.test.ts @@ -47,7 +47,17 @@ describe("web logout", () => { async () => { const { logoutWeb, WA_WEB_AUTH_DIR } = await import("./session.js"); - expect(WA_WEB_AUTH_DIR.startsWith(tmpDir)).toBe(true); + const normalizedAuthDir = path.resolve(WA_WEB_AUTH_DIR); + const normalizedHome = path.resolve(tmpDir); + if (process.platform === "win32") { + expect( + normalizedAuthDir + .toLowerCase() + .startsWith(normalizedHome.toLowerCase()), + ).toBe(true); + } else { + expect(normalizedAuthDir.startsWith(normalizedHome)).toBe(true); + } fs.mkdirSync(WA_WEB_AUTH_DIR, { recursive: true }); fs.writeFileSync(path.join(WA_WEB_AUTH_DIR, "creds.json"), "{}"); const result = await logoutWeb({ runtime: runtime as never });