mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-24 19:35:28 -06:00
ffb2ed9e89
* refactor: remove residual normalization aliases * test(gateway): isolate approval authority handshake
18 lines
685 B
TypeScript
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.",
|
|
);
|
|
});
|
|
});
|