test: tighten cli parser error assertions · openclaw/openclaw@fad580f
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -96,7 +96,7 @@ describe("parseByteSize", () => {
|
96 | 96 | }); |
97 | 97 | |
98 | 98 | it.each(["", "nope", "-5kb"] as const)("rejects invalid value %j", (input) => { |
99 | | -expect(() => parseByteSize(input)).toThrow(); |
| 99 | +expect(() => parseByteSize(input)).toThrow(/Invalid byte size/); |
100 | 100 | }); |
101 | 101 | }); |
102 | 102 | |
@@ -115,7 +115,7 @@ describe("parseDurationMs", () => {
|
115 | 115 | }); |
116 | 116 | |
117 | 117 | it("rejects invalid composite strings", () => { |
118 | | -expect(() => parseDurationMs("1h30")).toThrow(); |
119 | | -expect(() => parseDurationMs("1h-30m")).toThrow(); |
| 118 | +expect(() => parseDurationMs("1h30")).toThrow(/Invalid duration/); |
| 119 | +expect(() => parseDurationMs("1h-30m")).toThrow(/Invalid duration/); |
120 | 120 | }); |
121 | 121 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。