Files
openclaw/test/scripts/check-docs-mdx.test.ts
2026-06-04 20:49:50 -04:00

26 lines
874 B
TypeScript

// Check Docs Mdx tests cover check docs mdx script behavior.
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");
});
});