fix(test): normalize scriptPath separators in cache-heal-self-heal assertion

Same root cause as the #369 test fix: buildHookCommand normalizes
backslashes to forward slashes for cross-platform safety (MSYS/Git Bash
mangling prevention). Test assertion at line 189 compared against the
raw scriptPath from mkdtempSync (backslash-separated on Windows),
causing CI failure on windows-latest while macOS and Ubuntu passed.

Aligns line 189 with line 234 which already had this normalization.
This commit is contained in:
Mert Koseoglu
2026-05-02 17:39:59 +03:00
parent 21c44d69a3
commit 35b6f90bbd
+2 -1
View File
@@ -186,7 +186,8 @@ describe("selfHealCacheHealHook", () => {
const after = JSON.parse(readFileSync(settingsPath, "utf-8"));
const cmd = after.hooks.SessionStart[0].hooks[0].command;
// Unix-form: just the script path, quoted, no node prefix.
expect(cmd).toBe(`"${scriptPath}"`);
// buildHookCommand normalizes backslashes → forward slashes for cross-platform safety.
expect(cmd).toBe(`"${scriptPath.replace(/\\/g, "/")}"`);
expect(cmd).not.toContain("/totally-gone/");
// Script should now have shebang + exec bit.