Files
openclaw/src/cli/program/helpers.test.ts
T
Peter Steinberger ffb2ed9e89 refactor: remove residual normalization aliases (#122956)
* refactor: remove residual normalization aliases

* test(gateway): isolate approval authority handshake
2026-08-12 20:26:30 -07:00

18 lines
685 B
TypeScript

// Program helper tests cover shared command registration and help helpers.
import { describe, expect, it } from "vitest";
import { collectOption, parseStrictPositiveIntOption } from "./helpers.js";
describe("program helpers", () => {
it("collectOption appends values in order", () => {
expect(collectOption("a")).toEqual(["a"]);
expect(collectOption("b", ["a"])).toEqual(["a", "b"]);
});
it("parseStrictPositiveIntOption rejects partial numeric strings", () => {
expect(parseStrictPositiveIntOption("10", "--limit")).toBe(10);
expect(() => parseStrictPositiveIntOption("10ms", "--limit")).toThrow(
"--limit must be a positive integer.",
);
});
});