test: tighten markdown table schema rejection · openclaw/openclaw@f1c2baf
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -7,6 +7,12 @@ describe("MarkdownTableModeSchema", () => {
|
7 | 7 | }); |
8 | 8 | |
9 | 9 | it("rejects unsupported values", () => { |
10 | | -expect(() => MarkdownTableModeSchema.parse("plain")).toThrow(); |
| 10 | +const result = MarkdownTableModeSchema.safeParse("plain"); |
| 11 | + |
| 12 | +expect(result.success).toBe(false); |
| 13 | +if (result.success) { |
| 14 | +throw new Error("Expected unsupported markdown table mode to fail schema validation."); |
| 15 | +} |
| 16 | +expect(result.error.issues[0]?.code).toBe("invalid_value"); |
11 | 17 | }); |
12 | 18 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。