mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-14 11:26:13 +00:00
* chore(tooling): enforce current formatter and refresh checks * chore(tooling): keep release changelog formatter-owned * chore(tooling): retain compatible Node type surface * ci: enforce formatting for docs-only changes * ci: isolate docs formatter check * chore(tooling): apply updated lint and format rules * chore(tooling): satisfy updated switch lint * style(ui): apply Linux formatter layout * test(doctor): match quiet local audio contribution * test(doctor): assert quiet output only * test(doctor): follow restored information contract
48 lines
1.8 KiB
TypeScript
48 lines
1.8 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseReportCliArgs } from "../../scripts/lib/report-cli-helpers.mjs";
|
|
|
|
describe("report-cli-helpers", () => {
|
|
it("parses report artifact paths", () => {
|
|
expect(
|
|
parseReportCliArgs([
|
|
"--root",
|
|
"/repo",
|
|
"--json",
|
|
"artifacts/report.json",
|
|
"--markdown",
|
|
"artifacts/report.md",
|
|
]),
|
|
).toEqual({
|
|
rootDir: "/repo",
|
|
jsonPath: "artifacts/report.json",
|
|
markdownPath: "artifacts/report.md",
|
|
});
|
|
});
|
|
|
|
it("rejects missing report option values", () => {
|
|
expect(() => parseReportCliArgs(["--root", "--json", "report.json"])).toThrow(
|
|
"Expected --root <value>.",
|
|
);
|
|
expect(() => parseReportCliArgs(["--root", "-h"])).toThrow("Expected --root <value>.");
|
|
expect(() => parseReportCliArgs(["--json"])).toThrow("Expected --json <value>.");
|
|
expect(() => parseReportCliArgs(["--json", "--markdown", "report.md"])).toThrow(
|
|
"Expected --json <value>.",
|
|
);
|
|
expect(() => parseReportCliArgs(["--json", "-h"])).toThrow("Expected --json <value>.");
|
|
expect(() => parseReportCliArgs(["--markdown", ""])).toThrow("Expected --markdown <value>.");
|
|
expect(() => parseReportCliArgs(["--markdown", "-h"])).toThrow("Expected --markdown <value>.");
|
|
});
|
|
|
|
it("rejects duplicate report artifact options", () => {
|
|
expect(() => parseReportCliArgs(["--root", "/repo-a", "--root", "/repo-b"])).toThrow(
|
|
"--root was provided more than once.",
|
|
);
|
|
expect(() => parseReportCliArgs(["--json", "first.json", "--json", "second.json"])).toThrow(
|
|
"--json was provided more than once.",
|
|
);
|
|
expect(() => parseReportCliArgs(["--markdown", "first.md", "--markdown", "second.md"])).toThrow(
|
|
"--markdown was provided more than once.",
|
|
);
|
|
});
|
|
});
|