test: update gateway.mode test to match default-to-local behavior (#54801) (#60094)

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 <bradgroux@users.noreply.github.com>
This commit is contained in:
Brad Groux
2026-04-03 00:59:51 -05:00
committed by GitHub
parent 9978d2276b
commit dda53a2ff8

View File

@@ -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) => {