mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 23:28:27 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { IncomingMessage } from "node:http";
|
||||
import { afterEach, beforeEach, describe, expect, test } from "vitest";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import type { ChannelPlugin } from "../channels/plugins/types.js";
|
||||
import { setActivePluginRegistry } from "../plugins/runtime.js";
|
||||
import { createIMessageTestPlugin, createTestRegistry } from "../test-utils/channel-plugins.js";
|
||||
@@ -26,7 +26,7 @@ describe("gateway hooks helpers", () => {
|
||||
token: "secret",
|
||||
path: "hooks///",
|
||||
},
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
const resolved = resolveHooksConfig(base);
|
||||
expect(resolved?.basePath).toBe("/hooks");
|
||||
expect(resolved?.token).toBe("secret");
|
||||
@@ -35,7 +35,7 @@ describe("gateway hooks helpers", () => {
|
||||
test("resolveHooksConfig rejects root path", () => {
|
||||
const cfg = {
|
||||
hooks: { enabled: true, token: "x", path: "/" },
|
||||
} as MoltbotConfig;
|
||||
} as OpenClawConfig;
|
||||
expect(() => resolveHooksConfig(cfg)).toThrow("hooks.path may not be '/'");
|
||||
});
|
||||
|
||||
@@ -43,7 +43,7 @@ describe("gateway hooks helpers", () => {
|
||||
const req = {
|
||||
headers: {
|
||||
authorization: "Bearer top",
|
||||
"x-moltbot-token": "header",
|
||||
"x-openclaw-token": "header",
|
||||
},
|
||||
} as unknown as IncomingMessage;
|
||||
const url = new URL("http://localhost/hooks/wake?token=query");
|
||||
@@ -52,7 +52,7 @@ describe("gateway hooks helpers", () => {
|
||||
expect(result1.fromQuery).toBe(false);
|
||||
|
||||
const req2 = {
|
||||
headers: { "x-moltbot-token": "header" },
|
||||
headers: { "x-openclaw-token": "header" },
|
||||
} as unknown as IncomingMessage;
|
||||
const result2 = extractHookToken(req2, url);
|
||||
expect(result2.token).toBe("header");
|
||||
|
||||
Reference in New Issue
Block a user