test: tighten channel config schema assertion · openclaw/openclaw@8e40d13
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,18 @@ describe("buildChannelConfigSchema", () => {
|
10 | 10 | it("builds json schema when toJSONSchema is available", () => { |
11 | 11 | const schema = z.object({ enabled: z.boolean().default(true) }); |
12 | 12 | const result = buildChannelConfigSchema(schema); |
13 | | -expect(result.schema).toMatchObject({ type: "object" }); |
| 13 | +expect(result.schema).toEqual({ |
| 14 | +$schema: "http://json-schema.org/draft-07/schema#", |
| 15 | +type: "object", |
| 16 | +properties: { |
| 17 | +enabled: { |
| 18 | +type: "boolean", |
| 19 | +default: true, |
| 20 | +}, |
| 21 | +}, |
| 22 | +required: ["enabled"], |
| 23 | +additionalProperties: false, |
| 24 | +}); |
14 | 25 | }); |
15 | 26 | |
16 | 27 | it("falls back when toJSONSchema is missing (zod v3 plugin compatibility)", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。