fix: add update env regression test (#713) (thanks @danielz1z)
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
### Changes
|
### 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.
|
- 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
|
## 2026.1.10
|
||||||
|
|
||||||
### Highlights
|
### Highlights
|
||||||
|
|||||||
@@ -19,4 +19,31 @@ describe("runCommandWithTimeout", () => {
|
|||||||
expect(result.code).toBe(0);
|
expect(result.code).toBe(0);
|
||||||
expect(result.stdout).toBe("ok");
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user