test: resolve golden fixture path with import.meta.dirname

new URL(import.meta.url).pathname keeps percent-encoding, so the test
failed with ENOENT when the checkout path contains a space. Use
import.meta.dirname like the other tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Casimir Arlabosse
2026-10-27 15:46:28 +08:00
co-authored by Claude Opus 5.5
parent 3dc88472ee
commit cb7e719e92
+1 -1
View File
@@ -110,7 +110,7 @@ test("render-settings: its write stamps the family sidecar too", () => {
// ── the fixtures stay the legacy pin: golden data reads unstamped ─────────── // ── the fixtures stay the legacy pin: golden data reads unstamped ───────────
test("golden fixtures are deliberately the unstamped legacy shape (lazy v1 = current-valid)", () => { test("golden fixtures are deliberately the unstamped legacy shape (lazy v1 = current-valid)", () => {
const here = path.dirname(new URL(import.meta.url).pathname); const here = import.meta.dirname;
const teach = JSON.parse(fs.readFileSync(path.join(here, "fixtures", "golden-data", "chats", "chat_mv27rrra_feff23b6.json"), "utf8")); const teach = JSON.parse(fs.readFileSync(path.join(here, "fixtures", "golden-data", "chats", "chat_mv27rrra_feff23b6.json"), "utf8"));
assert.equal(teach.version, undefined, "fixture records pin the unstamped read path"); assert.equal(teach.version, undefined, "fixture records pin the unstamped read path");
assert.ok(!fs.existsSync(path.join(here, "fixtures", "golden-data", "graph", "format.json")), "no sidecar in the fixture graph dir"); assert.ok(!fs.existsSync(path.join(here, "fixtures", "golden-data", "graph", "format.json")), "no sidecar in the fixture graph dir");