mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 07:12:42 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -86,6 +86,8 @@ describe("gateway bonjour advertiser", () => {
|
||||
process.env.NODE_ENV = "development";
|
||||
|
||||
vi.spyOn(os, "hostname").mockReturnValue("test-host");
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
|
||||
const destroy = vi.fn().mockResolvedValue(undefined);
|
||||
const advertise = vi.fn().mockImplementation(
|
||||
@@ -111,12 +113,12 @@ describe("gateway bonjour advertiser", () => {
|
||||
gatewayPort: 18789,
|
||||
sshPort: 2222,
|
||||
tailnetDns: "host.tailnet.ts.net",
|
||||
cliPath: "/opt/homebrew/bin/moltbot",
|
||||
cliPath: "/opt/homebrew/bin/openclaw",
|
||||
});
|
||||
|
||||
expect(createService).toHaveBeenCalledTimes(1);
|
||||
const [gatewayCall] = createService.mock.calls as Array<[Record<string, unknown>]>;
|
||||
expect(gatewayCall?.[0]?.type).toBe("moltbot-gw");
|
||||
expect(gatewayCall?.[0]?.type).toBe("openclaw-gw");
|
||||
const gatewayType = asString(gatewayCall?.[0]?.type, "");
|
||||
expect(gatewayType.length).toBeLessThanOrEqual(15);
|
||||
expect(gatewayCall?.[0]?.port).toBe(18789);
|
||||
@@ -126,7 +128,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.gatewayPort).toBe("18789");
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.sshPort).toBe("2222");
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.cliPath).toBe(
|
||||
"/opt/homebrew/bin/moltbot",
|
||||
"/opt/homebrew/bin/openclaw",
|
||||
);
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.transport).toBe("gateway");
|
||||
|
||||
@@ -163,7 +165,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
const started = await startGatewayBonjourAdvertiser({
|
||||
gatewayPort: 18789,
|
||||
sshPort: 2222,
|
||||
cliPath: "/opt/homebrew/bin/moltbot",
|
||||
cliPath: "/opt/homebrew/bin/openclaw",
|
||||
minimal: true,
|
||||
});
|
||||
|
||||
@@ -180,6 +182,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
process.env.NODE_ENV = "development";
|
||||
|
||||
vi.spyOn(os, "hostname").mockReturnValue("test-host");
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
|
||||
const destroy = vi.fn().mockResolvedValue(undefined);
|
||||
const advertise = vi.fn().mockResolvedValue(undefined);
|
||||
@@ -217,6 +220,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
process.env.NODE_ENV = "development";
|
||||
|
||||
vi.spyOn(os, "hostname").mockReturnValue("test-host");
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
|
||||
const destroy = vi.fn().mockResolvedValue(undefined);
|
||||
const advertise = vi.fn().mockResolvedValue(undefined);
|
||||
@@ -261,6 +265,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
|
||||
vi.useFakeTimers();
|
||||
vi.spyOn(os, "hostname").mockReturnValue("test-host");
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
|
||||
const destroy = vi.fn().mockResolvedValue(undefined);
|
||||
const advertise = vi
|
||||
@@ -308,6 +313,7 @@ describe("gateway bonjour advertiser", () => {
|
||||
process.env.NODE_ENV = "development";
|
||||
|
||||
vi.spyOn(os, "hostname").mockReturnValue("test-host");
|
||||
process.env.OPENCLAW_MDNS_HOSTNAME = "test-host";
|
||||
|
||||
const destroy = vi.fn().mockResolvedValue(undefined);
|
||||
const advertise = vi.fn(() => {
|
||||
@@ -364,10 +370,10 @@ describe("gateway bonjour advertiser", () => {
|
||||
});
|
||||
|
||||
const [gatewayCall] = createService.mock.calls as Array<[ServiceCall]>;
|
||||
expect(gatewayCall?.[0]?.name).toBe("Mac (Moltbot)");
|
||||
expect(gatewayCall?.[0]?.name).toBe("openclaw (OpenClaw)");
|
||||
expect(gatewayCall?.[0]?.domain).toBe("local");
|
||||
expect(gatewayCall?.[0]?.hostname).toBe("Mac");
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.lanHost).toBe("Mac.local");
|
||||
expect(gatewayCall?.[0]?.hostname).toBe("openclaw");
|
||||
expect((gatewayCall?.[0]?.txt as Record<string, string>)?.lanHost).toBe("openclaw.local");
|
||||
|
||||
await started.stop();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user