fix: expose gh read/view help surface
This commit is contained in:
@@ -457,6 +457,17 @@ async function startMockGitHub(): Promise<{ baseUrl: string; requests: MockReque
|
||||
}
|
||||
|
||||
export async function runGhCliIssueGuardContract(): Promise<JsonRecord> {
|
||||
const help = await runCli(["gh", "help"]);
|
||||
assertCondition(help.status === 0, "gh help should succeed", help.json ?? { stdout: help.stdout });
|
||||
const helpData = dataOf(help.json ?? {});
|
||||
const usage = Array.isArray(helpData.usage) ? helpData.usage.map((value) => String(value)) : [];
|
||||
const notes = Array.isArray(helpData.notes) ? helpData.notes.map((value) => String(value)) : [];
|
||||
assertCondition(usage.some((line) => line.includes("gh issue list")), "gh help should list issue list", { usage });
|
||||
assertCondition(usage.some((line) => line.includes("gh issue read")), "gh help should list issue read", { usage });
|
||||
assertCondition(usage.some((line) => line.includes("gh issue view")), "gh help should list issue view", { usage });
|
||||
assertCondition(notes.some((line) => line.includes("canonical read path")), "gh help should state issue read is canonical", { notes });
|
||||
assertCondition(notes.some((line) => line.includes("compatibility alias")), "gh help should state issue view is alias", { notes });
|
||||
|
||||
const mock = await startMockGitHub();
|
||||
const tmp = mkdtempSync(join(tmpdir(), "unidesk-gh-issue-guard-"));
|
||||
const env = {
|
||||
|
||||
Reference in New Issue
Block a user