mirror of
https://github.com/mksglu/context-mode.git
synced 2026-10-02 12:25:33 +08:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user