diff --git a/tests/commands.test.mjs b/tests/commands.test.mjs index a00e8dd..809fdff 100644 --- a/tests/commands.test.mjs +++ b/tests/commands.test.mjs @@ -2,8 +2,9 @@ import fs from "node:fs"; import path from "node:path"; import test from "node:test"; import assert from "node:assert/strict"; +import { fileURLToPath } from "node:url"; -const ROOT = "/Users/dkundel/code/codex-plugin"; +const ROOT = path.resolve(fileURLToPath(new URL("..", import.meta.url))); const PLUGIN_ROOT = path.join(ROOT, "plugins", "codex"); function read(relativePath) { diff --git a/tests/runtime.test.mjs b/tests/runtime.test.mjs index 43ed17c..15f96c5 100644 --- a/tests/runtime.test.mjs +++ b/tests/runtime.test.mjs @@ -3,13 +3,14 @@ import path from "node:path"; import test from "node:test"; import assert from "node:assert/strict"; import { spawn } from "node:child_process"; +import { fileURLToPath } from "node:url"; import { buildEnv, installFakeCodex } from "./fake-codex-fixture.mjs"; import { initGitRepo, makeTempDir, run } from "./helpers.mjs"; import { loadBrokerSession } from "../plugins/codex/scripts/lib/broker-lifecycle.mjs"; import { resolveStateDir } from "../plugins/codex/scripts/lib/state.mjs"; -const ROOT = "/Users/dkundel/code/codex-plugin"; +const ROOT = path.resolve(fileURLToPath(new URL("..", import.meta.url))); const PLUGIN_ROOT = path.join(ROOT, "plugins", "codex"); const SCRIPT = path.join(PLUGIN_ROOT, "scripts", "codex-companion.mjs"); const STOP_HOOK = path.join(PLUGIN_ROOT, "scripts", "stop-review-gate-hook.mjs");