mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-11 14:04:49 -05:00
Fixes the failing `codexPackagePaths` unit test. The static
`import { createRequire } from 'node:module'` poisoned the whole module in
the electron-renderer unit-test loader (bare builtins like `fs`/`child_process`
are externalized there, but a static `node:module` import is fetched as a URL
and fails — "Failed to fetch dynamically imported module"). Resolve
`createRequire` via a dynamic `await import('node:module')` instead, matching
the sibling `wslRemoteAgentHostService` / `sshRemoteAgentHostService` pattern.
Also addresses the code-review note that `resolveCodexDevSdkRoot()` was
untested: export it with an injectable resolver seam (consistent with the
already-exported, already-tested `codexPackageSuffix`/`codexBinaryTriple` in
the same file) and add unit tests for the resolvable and throwing cases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>