Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(debug-web-ui): cover mergeChildEnv overrides and removals

Steven Enamakel3f963b6c3fcd
diff --git a/scripts/__tests__/debug-web-ui.test.mjs b/scripts/__tests__/debug-web-ui.test.mjs
index d07a6a063c..0a914606fe 100644
--- a/scripts/__tests__/debug-web-ui.test.mjs
+++ b/scripts/__tests__/debug-web-ui.test.mjs
@@ -4,6 +4,7 @@ import test from "node:test";
import {
devConnectUrl,
+ mergeChildEnv,
freePort,
isLoopback,
parseArgs,
@@ -11,6 +12,16 @@ import {
waitFor,
} from "../debug/web-ui-lib.mjs";
+test("mergeChildEnv overrides and removes inherited variables", () => {
+ assert.deepEqual(
+ mergeChildEnv(
+ { KEEP: "parent", REMOVE: "credential", OVERRIDE: "parent" },
+ { REMOVE: null, OVERRIDE: "private", ADD: "value" },
+ ),
+ { KEEP: "parent", OVERRIDE: "private", ADD: "value" },
+ );
+});
+
test("parseArgs defaults to an interactive, signed-in run that builds the core", () => {
assert.deepEqual(parseArgs([]), {
script: null,