From 2a2e1f15f5461baa9cbc299fc3cf31ae0d18c679 Mon Sep 17 00:00:00 2001 From: Aaron Stainback Date: Wed, 20 May 2026 16:14:24 -0400 Subject: [PATCH] fix(bg-notifier-test): use path.join for platform-independent assertions PR #4449 review finding (Copilot P1, post-merge): the test "defaultHistoryFile honors ZETA_BUS_DIR" hard-coded "/var/zeta-test/assignment-history.json" but defaultHistoryFile uses path.join, which returns OS-native separators (backslashes on Windows). The assertion would fail on a Windows CI leg even though no Windows workflow exists today. Computed expected values with path.join() for portability. 49/49 tests still pass; tsc clean. Co-Authored-By: Claude --- tools/bg/backlog-ready-notifier.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/bg/backlog-ready-notifier.test.ts b/tools/bg/backlog-ready-notifier.test.ts index 9d633f111d..35181c22a2 100644 --- a/tools/bg/backlog-ready-notifier.test.ts +++ b/tools/bg/backlog-ready-notifier.test.ts @@ -1,4 +1,5 @@ import { describe, expect, test } from "bun:test"; +import { join } from "node:path"; import { DEFAULT_CONFIG, defaultHistoryFile, @@ -469,12 +470,15 @@ title: only a title describe("assignment-history cooldown (slice 5a)", () => { test("defaultHistoryFile honors ZETA_BUS_DIR env var when set", () => { + // Use `path.join` for expected values so the assertion is platform- + // independent (PR #4449 review finding: hard-coded forward slashes + // would fail on Windows where path.join returns backslashes). const before = process.env.ZETA_BUS_DIR; try { process.env.ZETA_BUS_DIR = "/var/zeta-test"; - expect(defaultHistoryFile()).toBe("/var/zeta-test/assignment-history.json"); + expect(defaultHistoryFile()).toBe(join("/var/zeta-test", "assignment-history.json")); delete process.env.ZETA_BUS_DIR; - expect(defaultHistoryFile()).toBe("/tmp/zeta-bus/assignment-history.json"); + expect(defaultHistoryFile()).toBe(join("/tmp/zeta-bus", "assignment-history.json")); } finally { if (before === undefined) delete process.env.ZETA_BUS_DIR; else process.env.ZETA_BUS_DIR = before;