fix: add update env regression test (#713) (thanks @danielz1z)

This commit is contained in:
Peter Steinberger
2026-01-11 10:48:46 +00:00
parent 7006a4aad3
commit 4a166cf227
2 changed files with 30 additions and 0 deletions

View File

@@ -5,6 +5,9 @@
### Changes
- macOS: prompt to install the global `clawdbot` CLI when missing in local mode; install via `clawd.bot/install-cli.sh` (no onboarding) and use external launchd/CLI instead of the embedded gateway runtime.
### Fixes
- CLI/Update: preserve base environment when passing overrides to update subprocesses. (#713) — thanks @danielz1z.
## 2026.1.10
### Highlights

View File

@@ -19,4 +19,31 @@ describe("runCommandWithTimeout", () => {
expect(result.code).toBe(0);
expect(result.stdout).toBe("ok");
});
it("merges custom env with process.env", async () => {
const previous = process.env.CLAWDBOT_BASE_ENV;
process.env.CLAWDBOT_BASE_ENV = "base";
try {
const result = await runCommandWithTimeout(
[
process.execPath,
"-e",
'process.stdout.write((process.env.CLAWDBOT_BASE_ENV ?? "") + "|" + (process.env.CLAWDBOT_TEST_ENV ?? ""))',
],
{
timeoutMs: 5_000,
env: { CLAWDBOT_TEST_ENV: "ok" },
},
);
expect(result.code).toBe(0);
expect(result.stdout).toBe("base|ok");
} finally {
if (previous === undefined) {
delete process.env.CLAWDBOT_BASE_ENV;
} else {
process.env.CLAWDBOT_BASE_ENV = previous;
}
}
});
});