mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 14:01:24 +08:00
26 lines
827 B
TypeScript
26 lines
827 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { parseArgs } from "../../scripts/check-docs-mdx.mjs";
|
|
|
|
describe("scripts/check-docs-mdx", () => {
|
|
it("parses roots and output options", () => {
|
|
expect(parseArgs(["docs", "README.md", "--json-out", "report.json", "--max-errors", "7"]))
|
|
.toEqual({
|
|
roots: ["docs", "README.md"],
|
|
jsonOut: "report.json",
|
|
maxErrors: 7,
|
|
});
|
|
});
|
|
|
|
it("rejects malformed max error limits", () => {
|
|
expect(() => parseArgs(["--max-errors", "2x"])).toThrow(
|
|
"--max-errors must be a positive integer",
|
|
);
|
|
expect(() => parseArgs(["--max-errors", "0"])).toThrow(
|
|
"--max-errors must be a positive integer",
|
|
);
|
|
expect(() => parseArgs(["--max-errors"])).toThrow(
|
|
"--max-errors must be a positive integer",
|
|
);
|
|
});
|
|
});
|