diff --git a/src/__tests__/acp-test-utils.ts b/src/__tests__/acp-test-utils.ts index df6bcb74..b905d792 100644 --- a/src/__tests__/acp-test-utils.ts +++ b/src/__tests__/acp-test-utils.ts @@ -190,7 +190,14 @@ export function createBaseTestFixture(config: ConnectionConfig): TestFixture { * Use for integration tests that need to interact with the actual Codex binary. */ export function createTestFixture(): TestFixture { - const pathToCodex = path.resolve(process.cwd(), "node_modules", ".bin", process.platform === 'win32' ? "codex.cmd" : "codex"); + const bundledCodexPath = path.resolve( + process.cwd(), + "node_modules", + ".bin", + process.platform === 'win32' ? "codex.cmd" : "codex", + ); + const pathToCodex = process.env["CODEX_PATH"] ?? bundledCodexPath; + if (!fs.existsSync(pathToCodex)) { throw new Error(`Codex binary not found at ${pathToCodex}. Did you run 'npm install'?`); }