it("ignores the legacy env name and falls back to config", () => {
expect(
resolveGatewayPort(
{ gateway: { port: 19002 } },
envWith({ CLAWDBOT_GATEWAY_PORT: "127.0.0.1:18789" }),
),
).toBe(19002);
});
it("falls back to config when the Compose-style suffix is invalid", () => {
expect(
resolveGatewayPort(
{ gateway: { port: 19003 } },
envWith({ OPENCLAW_GATEWAY_PORT: "127.0.0.1:not-a-port" }),
),
).toBe(19003);
});
it("falls back when malformed IPv6 inputs do not provide an explicit port", () => {
expect(
resolveGatewayPort({ gateway: { port: 19003 } }, envWith({ OPENCLAW_GATEWAY_PORT: "::1" })),
).toBe(19003);
expect(resolveGatewayPort({}, envWith({ OPENCLAW_GATEWAY_PORT: "2001:db8::1" }))).toBe(
DEFAULT_GATEWAY_PORT,
);
});
it("falls back to the default port when env is invalid and config is unset", () => {
expect(resolveGatewayPort({}, envWith({ OPENCLAW_GATEWAY_PORT: "127.0.0.1:not-a-port" }))).toBe(
DEFAULT_GATEWAY_PORT,
);
});
});
describe("state + config path candidates", () => { function expectOpenClawHomeDefaults(env: NodeJS.ProcessEnv): void { const configuredHome = env.OPENCLAW_HOME; if (!configuredHome) { thrownew Error("OPENCLAW_HOME must be set for this assertion helper");
} const resolvedHome = path.resolve(configuredHome);
expect(resolveStateDir(env)).toBe(path.join(resolvedHome, ".openclaw"));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.