Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

test(mcp): resolve the native binding in candidate fixtures (#2372)

Michael D'Angelo083fccf8c0c6
diff --git a/.github/workflows/node-ci.yml b/.github/workflows/node-ci.yml
index 579357e65..fcc640ed4 100644
--- a/.github/workflows/node-ci.yml
+++ b/.github/workflows/node-ci.yml
@@ -548,7 +548,7 @@ jobs:
if: matrix.shard == 1
working-directory: plugins/codex-security/mcp-app
env: *windows-shard-env
- run: node --experimental-strip-types --test --test-reporter=tap tests/test_helper_files.ts
+ run: node --experimental-strip-types --test --test-reporter=tap tests/test_helper_files.ts tests/test_normalize_candidates.ts
- name: Upload Windows test reports
if: always()
continue-on-error: true
diff --git a/plugins/codex-security/mcp-app/tests/test_normalize_candidates.ts b/plugins/codex-security/mcp-app/tests/test_normalize_candidates.ts
index 20d6bd393..6ace7a96f 100644
--- a/plugins/codex-security/mcp-app/tests/test_normalize_candidates.ts
+++ b/plugins/codex-security/mcp-app/tests/test_normalize_candidates.ts
@@ -5,9 +5,14 @@ import { test } from "node:test";
import { importSource } from "./import-module.ts";
import { temporaryDirectory } from "./support/temporary-directories.ts";
+const helperUrl = new URL(
+ "../../../../sdk/typescript/_bundled_plugin/mcp/helpers.mjs",
+ import.meta.url,
+);
const { normalizeCandidateBatch, normalizeCandidatesCommand } =
await importSource(
join(import.meta.dirname, "../src/helpers/normalize-candidates.ts"),
+ { define: { "import.meta.url": JSON.stringify(helperUrl.href) } },
);
const cases = [
@@ -41,7 +46,7 @@ const cases = [
files: ["file"],
inventory: "deleted\nfile\n",
candidate: "file",
- error: /ENOENT/,
+ error: /in-scope file row 1:.*(?:ENOENT|Windows filesystem error 2:)/u,
},
];