test: tighten cli parser error assertions

This commit is contained in:
Peter Steinberger
2026-05-09 01:18:52 +01:00
parent 41cf024776
commit fad580ff18

View File

@@ -96,7 +96,7 @@ describe("parseByteSize", () => {
});
it.each(["", "nope", "-5kb"] as const)("rejects invalid value %j", (input) => {
expect(() => parseByteSize(input)).toThrow();
expect(() => parseByteSize(input)).toThrow(/Invalid byte size/);
});
});
@@ -115,7 +115,7 @@ describe("parseDurationMs", () => {
});
it("rejects invalid composite strings", () => {
expect(() => parseDurationMs("1h30")).toThrow();
expect(() => parseDurationMs("1h-30m")).toThrow();
expect(() => parseDurationMs("1h30")).toThrow(/Invalid duration/);
expect(() => parseDurationMs("1h-30m")).toThrow(/Invalid duration/);
});
});