feat(process): support env overrides in exec
This commit is contained in:
22
src/process/exec.test.ts
Normal file
22
src/process/exec.test.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { runCommandWithTimeout } from "./exec.js";
|
||||
|
||||
describe("runCommandWithTimeout", () => {
|
||||
it("passes env overrides to child", async () => {
|
||||
const result = await runCommandWithTimeout(
|
||||
[
|
||||
process.execPath,
|
||||
"-e",
|
||||
'process.stdout.write(process.env.CLAWDIS_TEST_ENV ?? "")',
|
||||
],
|
||||
{
|
||||
timeoutMs: 5_000,
|
||||
env: { CLAWDIS_TEST_ENV: "ok" },
|
||||
},
|
||||
);
|
||||
|
||||
expect(result.code).toBe(0);
|
||||
expect(result.stdout).toBe("ok");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user