Skip to content

Commit 1f34a42

Browse files
luvs01Wibias
authored andcommitted
test(codex): cover non-default shim provenance
1 parent 1977aa0 commit 1f34a42

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/codex-shim.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ describe("Codex autostart shim", () => {
184184
expect(script).toContain("& 'C:\\codex-real.ps1' @args");
185185
});
186186

187+
test("shim builders preserve explicit Bun runtime provenance", () => {
188+
for (const source of ["override", "bundled"] as const) {
189+
const unix = buildUnixCodexShim("/bin/codex", "/bin/bun", "/cli.ts", undefined, source);
190+
const cmd = buildWindowsCodexShim("C:\\codex.exe", "C:\\bun.exe", "C:\\cli.ts", source);
191+
const powershell = buildWindowsPowerShellCodexShim("C:\\codex.ps1", "C:\\bun.exe", "C:\\cli.ts", source);
192+
193+
expect(unix).toContain(`OCX_BUN_RUNTIME_SOURCE='${source}'`);
194+
expect(cmd).toContain(`set "OCX_BUN_RUNTIME_SOURCE=${source}"`);
195+
expect(powershell).toContain(`$env:OCX_BUN_RUNTIME_SOURCE = '${source}'`);
196+
}
197+
});
198+
187199
test("Unix shim treats executable paths as literals instead of shell interpolation", () => {
188200
if (process.platform === "win32") return;
189201

0 commit comments

Comments
 (0)