mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-06 05:51:15 +08:00
26 lines
874 B
TypeScript
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");
|
|
});
|
|
});
|