tests: derive repo roots from test file locations (#34)

Co-authored-by: VOIDXAI <VOIDXAI@users.noreply.github.com>
This commit is contained in:
VOIDXAI 2026-04-01 03:33:32 +08:00 committed by GitHub
parent 9cb4fe4099
commit 19642ad95f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -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) {

View File

@ -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");