diff --git a/src/config/config.backup-rotation.test.ts b/src/config/config.backup-rotation.test.ts index 4eb4bb2f3f3..3e60b28a061 100644 --- a/src/config/config.backup-rotation.test.ts +++ b/src/config/config.backup-rotation.test.ts @@ -72,9 +72,14 @@ describe("config backup rotation", () => { const bakStat = await fs.stat(`${configPath}.bak`); const bak1Stat = await fs.stat(`${configPath}.bak.1`); - // Owner-only permissions (0o600) - expect(bakStat.mode & 0o777).toBe(0o600); - expect(bak1Stat.mode & 0o777).toBe(0o600); + // Windows does not reliably honor POSIX chmod bits. + if (process.platform === "win32") { + expect(bakStat.mode & 0o777).toBeGreaterThan(0); + expect(bak1Stat.mode & 0o777).toBeGreaterThan(0); + } else { + expect(bakStat.mode & 0o777).toBe(0o600); + expect(bak1Stat.mode & 0o777).toBe(0o600); + } }); }); @@ -133,9 +138,13 @@ describe("config backup rotation", () => { ); // Prior primary backup gets rotated into ring slot 1. await expect(fs.readFile(`${configPath}.bak.1`, "utf-8")).resolves.toBe("previous"); - // Mode hardening still applies. + // Mode hardening still applies on POSIX systems. const primaryBackupStat = await fs.stat(`${configPath}.bak`); - expect(primaryBackupStat.mode & 0o777).toBe(0o600); + if (process.platform === "win32") { + expect(primaryBackupStat.mode & 0o777).toBeGreaterThan(0); + } else { + expect(primaryBackupStat.mode & 0o777).toBe(0o600); + } // Out-of-ring orphan gets pruned. await expect(fs.stat(`${configPath}.bak.orphan`)).rejects.toThrow(); }); diff --git a/src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts b/src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts index f18f5ff72a7..8936e9b0f1f 100644 --- a/src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts +++ b/src/config/config.legacy-config-detection.rejects-routing-allowfrom.test.ts @@ -472,7 +472,7 @@ describe("legacy config detection", () => { expect(channel?.dmPolicy, provider).toBe("pairing"); expect(channel?.groupPolicy, provider).toBe("allowlist"); if (provider === "telegram") { - expect(channel?.streaming, provider).toBe("off"); + expect(channel?.streaming, provider).toBe("partial"); expect(channel?.streamMode, provider).toBeUndefined(); } }