Files
reverse-engineering-anything/tests/boundary/cli/commandManifests.test.ts
T
sunfleeting f93a8db72d fix(cli): use canonical option flags in llms manifests (#11928)
The --llms-full manifest and discovery table rendered raw object keys
(--blockSize), which disagreed with command help (--block-size). Reuse
optionFlagName so manifests emit the same canonical flags as help, and
update the two CLI parity goldens. Adds a boundary test asserting both
surfaces agree on canonical flag names.
2026-11-18 10:57:01 -05:00

33 lines
1.1 KiB
TypeScript

import { expect, it } from "vitest";
import { z } from "zod";
import type { CliCommandEntry } from "../../../src/cli/commandRegistry.js";
import { formatLlmsFull } from "../../../src/cli/commandManifests.js";
import { formatCommandHelp } from "../../../src/cli/help.js";
it("uses the same canonical option flags as command help", () => {
const command: CliCommandEntry = {
name: "sample",
definition: {
options: z.object({
blockSize: z.number().optional().describe("Bytes per block"),
dryRun: z.boolean().default(false).describe("Dry run"),
}),
run: () => undefined,
},
operations: [],
source: { kind: "host" },
};
const help = formatCommandHelp("rea sample", {
options: command.definition.options,
});
const manifest = formatLlmsFull("rea", [command]);
expect(help).toContain("--block-size <number>");
expect(help).toContain("--dry-run");
expect(manifest).toContain("| `--block-size` |");
expect(manifest).toContain("| `--dry-run` |");
expect(manifest).not.toContain("--blockSize");
expect(manifest).not.toContain("--dryRun");
});