From dda53a2ff83b1ad88272193209ce77d4fafdea69 Mon Sep 17 00:00:00 2001 From: Brad Groux <3053586+BradGroux@users.noreply.github.com> Date: Fri, 3 Apr 2026 00:59:51 -0500 Subject: [PATCH] test: update gateway.mode test to match default-to-local behavior (#54801) (#60094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test previously asserted that a valid snapshot without gateway.mode blocks startup. After defaulting gateway.mode to 'local' when unset, the gateway should start successfully in this scenario — update the test to verify the new expected behavior. Co-authored-by: Brad Groux --- src/cli/gateway-cli/run.option-collisions.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/cli/gateway-cli/run.option-collisions.test.ts b/src/cli/gateway-cli/run.option-collisions.test.ts index 874f7a5cd5e..7302cc230e6 100644 --- a/src/cli/gateway-cli/run.option-collisions.test.ts +++ b/src/cli/gateway-cli/run.option-collisions.test.ts @@ -207,7 +207,7 @@ describe("gateway run option collisions", () => { ); }); - it("blocks startup when the observed snapshot loses gateway.mode even if loadConfig still says local", async () => { + it("defaults to local when snapshot is valid but has no gateway.mode", async () => { configState.cfg = { gateway: { mode: "local", @@ -224,12 +224,10 @@ describe("gateway run option collisions", () => { }, }; - await expect(runGatewayCli(["gateway", "run"])).rejects.toThrow("__exit__:1"); + // Should NOT block — gateway.mode defaults to "local" when unset (#54801) + await runGatewayCli(["gateway", "run"]); - expect(runtimeErrors).toContain( - "Gateway start blocked: set gateway.mode=local (current: unset) or pass --allow-unconfigured.", - ); - expect(startGatewayServer).not.toHaveBeenCalled(); + expect(startGatewayServer).toHaveBeenCalled(); }); it.each(["none", "trusted-proxy"] as const)("accepts --auth %s override", async (mode) => {