

























@@ -36,6 +36,18 @@ describe("config doc baseline integration", () => {
3636return sharedByPathPromise;
3737}
383839+function requireEntry(
40+byPath: Map<string, ConfigDocBaselineEntry>,
41+entryPath: string,
42+): ConfigDocBaselineEntry {
43+const entry = byPath.get(entryPath);
44+expect(entry).toBeDefined();
45+if (!entry) {
46+throw new Error(`expected config doc baseline entry for ${entryPath}`);
47+}
48+return entry;
49+}
50+3951it("is deterministic across repeated runs", async () => {
4052const first = await getSharedRendered();
4153const { baseline } = first;
@@ -50,18 +62,17 @@ describe("config doc baseline integration", () => {
5062it("includes core, channel, and plugin config metadata", async () => {
5163const byPath = await getSharedByPath();
526453-expect(byPath.get("gateway.auth.token")).toMatchObject({
54-kind: "core",
55-sensitive: true,
56-});
57-expect(byPath.get("channels.telegram.botToken")).toMatchObject({
58-kind: "channel",
59-sensitive: true,
60-});
61-expect(byPath.get("plugins.entries.voice-call.config.twilio.authToken")).toMatchObject({
62-kind: "plugin",
63-sensitive: true,
64-});
65+const gatewayToken = requireEntry(byPath, "gateway.auth.token");
66+expect(gatewayToken.kind).toBe("core");
67+expect(gatewayToken.sensitive).toBe(true);
68+69+const telegramToken = requireEntry(byPath, "channels.telegram.botToken");
70+expect(telegramToken.kind).toBe("channel");
71+expect(telegramToken.sensitive).toBe(true);
72+73+const twilioToken = requireEntry(byPath, "plugins.entries.voice-call.config.twilio.authToken");
74+expect(twilioToken.kind).toBe("plugin");
75+expect(twilioToken.sensitive).toBe(true);
6576});
66776778it("preserves help text and tags from merged schema hints", async () => {
@@ -83,44 +94,38 @@ describe("config doc baseline integration", () => {
8394it("uses human-readable channel metadata for top-level channel sections", async () => {
8495const byPath = await getSharedByPath();
859686-expect(byPath.get("channels.discord")).toMatchObject({
87-label: "Discord",
88-help: "very well supported right now.",
89-});
90-expect(byPath.get("channels.msteams")).toMatchObject({
91-label: "Microsoft Teams",
92-help: "Teams SDK; enterprise support.",
93-});
94-expect(byPath.get("channels.matrix")).toMatchObject({
95-label: "Matrix",
96-help: "open protocol; install the plugin to enable.",
97-});
98-expect(byPath.get("channels.msteams")?.label).not.toContain("@openclaw/");
99-expect(byPath.get("channels.matrix")?.help).not.toContain("homeserver");
97+const discordEntry = requireEntry(byPath, "channels.discord");
98+expect(discordEntry.label).toBe("Discord");
99+expect(discordEntry.help).toBe("very well supported right now.");
100+101+const msteamsEntry = requireEntry(byPath, "channels.msteams");
102+expect(msteamsEntry.label).toBe("Microsoft Teams");
103+expect(msteamsEntry.help).toBe("Teams SDK; enterprise support.");
104+expect(msteamsEntry.label).not.toContain("@openclaw/");
105+106+const matrixEntry = requireEntry(byPath, "channels.matrix");
107+expect(matrixEntry.label).toBe("Matrix");
108+expect(matrixEntry.help).toBe("open protocol; install the plugin to enable.");
109+expect(matrixEntry.help).not.toContain("homeserver");
100110});
101111102112it("matches array help hints that still use [] notation", async () => {
103113const byPath = await getSharedByPath();
104114105-expect(byPath.get("session.sendPolicy.rules.*.match.keyPrefix")).toMatchObject({
106-help: expect.stringContaining("prefer rawKeyPrefix when exact full-key matching is required"),
107-sensitive: false,
108-});
115+const keyPrefixEntry = requireEntry(byPath, "session.sendPolicy.rules.*.match.keyPrefix");
116+expect(keyPrefixEntry.help).toContain(
117+"prefer rawKeyPrefix when exact full-key matching is required",
118+);
119+expect(keyPrefixEntry.sensitive).toBe(false);
109120});
110121111122it("walks union branches for nested config keys", async () => {
112123const byPath = await getSharedByPath();
113124114-expect(byPath.get("bindings.*")).toMatchObject({
115-hasChildren: true,
116-});
117-expect(byPath.get("bindings.*.type")).toMatchObject({ path: "bindings.*.type" });
118-expect(byPath.get("bindings.*.match.channel")).toMatchObject({
119-path: "bindings.*.match.channel",
120-});
121-expect(byPath.get("bindings.*.match.peer.id")).toMatchObject({
122-path: "bindings.*.match.peer.id",
123-});
125+expect(requireEntry(byPath, "bindings.*").hasChildren).toBe(true);
126+expect(requireEntry(byPath, "bindings.*.type").path).toBe("bindings.*.type");
127+expect(requireEntry(byPath, "bindings.*.match.channel").path).toBe("bindings.*.match.channel");
128+expect(requireEntry(byPath, "bindings.*.match.peer.id").path).toBe("bindings.*.match.peer.id");
124129});
125130126131it("supports check mode for stale hash files", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。