mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:51:22 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -16,17 +16,17 @@ describe("browser config", () => {
|
||||
expect(profile?.cdpPort).toBe(18792);
|
||||
expect(profile?.cdpUrl).toBe("http://127.0.0.1:18792");
|
||||
|
||||
const clawd = resolveProfile(resolved, "clawd");
|
||||
expect(clawd?.driver).toBe("clawd");
|
||||
expect(clawd?.cdpPort).toBe(18800);
|
||||
expect(clawd?.cdpUrl).toBe("http://127.0.0.1:18800");
|
||||
const openclaw = resolveProfile(resolved, "openclaw");
|
||||
expect(openclaw?.driver).toBe("openclaw");
|
||||
expect(openclaw?.cdpPort).toBe(18800);
|
||||
expect(openclaw?.cdpUrl).toBe("http://127.0.0.1:18800");
|
||||
expect(resolved.remoteCdpTimeoutMs).toBe(1500);
|
||||
expect(resolved.remoteCdpHandshakeTimeoutMs).toBe(3000);
|
||||
});
|
||||
|
||||
it("derives default ports from CLAWDBOT_GATEWAY_PORT when unset", () => {
|
||||
const prev = process.env.CLAWDBOT_GATEWAY_PORT;
|
||||
process.env.CLAWDBOT_GATEWAY_PORT = "19001";
|
||||
it("derives default ports from OPENCLAW_GATEWAY_PORT when unset", () => {
|
||||
const prev = process.env.OPENCLAW_GATEWAY_PORT;
|
||||
process.env.OPENCLAW_GATEWAY_PORT = "19001";
|
||||
try {
|
||||
const resolved = resolveBrowserConfig(undefined);
|
||||
expect(resolved.controlPort).toBe(19003);
|
||||
@@ -35,21 +35,21 @@ describe("browser config", () => {
|
||||
expect(chrome?.cdpPort).toBe(19004);
|
||||
expect(chrome?.cdpUrl).toBe("http://127.0.0.1:19004");
|
||||
|
||||
const clawd = resolveProfile(resolved, "clawd");
|
||||
expect(clawd?.cdpPort).toBe(19012);
|
||||
expect(clawd?.cdpUrl).toBe("http://127.0.0.1:19012");
|
||||
const openclaw = resolveProfile(resolved, "openclaw");
|
||||
expect(openclaw?.cdpPort).toBe(19012);
|
||||
expect(openclaw?.cdpUrl).toBe("http://127.0.0.1:19012");
|
||||
} finally {
|
||||
if (prev === undefined) {
|
||||
delete process.env.CLAWDBOT_GATEWAY_PORT;
|
||||
delete process.env.OPENCLAW_GATEWAY_PORT;
|
||||
} else {
|
||||
process.env.CLAWDBOT_GATEWAY_PORT = prev;
|
||||
process.env.OPENCLAW_GATEWAY_PORT = prev;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
it("derives default ports from gateway.port when env is unset", () => {
|
||||
const prev = process.env.CLAWDBOT_GATEWAY_PORT;
|
||||
delete process.env.CLAWDBOT_GATEWAY_PORT;
|
||||
const prev = process.env.OPENCLAW_GATEWAY_PORT;
|
||||
delete process.env.OPENCLAW_GATEWAY_PORT;
|
||||
try {
|
||||
const resolved = resolveBrowserConfig(undefined, { gateway: { port: 19011 } });
|
||||
expect(resolved.controlPort).toBe(19013);
|
||||
@@ -58,14 +58,14 @@ describe("browser config", () => {
|
||||
expect(chrome?.cdpPort).toBe(19014);
|
||||
expect(chrome?.cdpUrl).toBe("http://127.0.0.1:19014");
|
||||
|
||||
const clawd = resolveProfile(resolved, "clawd");
|
||||
expect(clawd?.cdpPort).toBe(19022);
|
||||
expect(clawd?.cdpUrl).toBe("http://127.0.0.1:19022");
|
||||
const openclaw = resolveProfile(resolved, "openclaw");
|
||||
expect(openclaw?.cdpPort).toBe(19022);
|
||||
expect(openclaw?.cdpUrl).toBe("http://127.0.0.1:19022");
|
||||
} finally {
|
||||
if (prev === undefined) {
|
||||
delete process.env.CLAWDBOT_GATEWAY_PORT;
|
||||
delete process.env.OPENCLAW_GATEWAY_PORT;
|
||||
} else {
|
||||
process.env.CLAWDBOT_GATEWAY_PORT = prev;
|
||||
process.env.OPENCLAW_GATEWAY_PORT = prev;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -97,7 +97,7 @@ describe("browser config", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
cdpUrl: "http://example.com:9222",
|
||||
});
|
||||
const profile = resolveProfile(resolved, "clawd");
|
||||
const profile = resolveProfile(resolved, "openclaw");
|
||||
expect(profile?.cdpIsLoopback).toBe(false);
|
||||
});
|
||||
|
||||
@@ -105,7 +105,7 @@ describe("browser config", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
cdpUrl: "http://example.com:9222",
|
||||
});
|
||||
const profile = resolveProfile(resolved, "clawd");
|
||||
const profile = resolveProfile(resolved, "openclaw");
|
||||
expect(profile?.cdpPort).toBe(9222);
|
||||
expect(profile?.cdpUrl).toBe("http://example.com:9222");
|
||||
expect(profile?.cdpIsLoopback).toBe(false);
|
||||
@@ -143,10 +143,10 @@ describe("browser config", () => {
|
||||
it("does not add the built-in chrome extension profile if the derived relay port is already used", () => {
|
||||
const resolved = resolveBrowserConfig({
|
||||
profiles: {
|
||||
clawd: { cdpPort: 18792, color: "#FF4500" },
|
||||
openclaw: { cdpPort: 18792, color: "#FF4500" },
|
||||
},
|
||||
});
|
||||
expect(resolveProfile(resolved, "chrome")).toBe(null);
|
||||
expect(resolved.defaultProfile).toBe("clawd");
|
||||
expect(resolved.defaultProfile).toBe("openclaw");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user