fix: expose gh read/view help surface

This commit is contained in:
Codex
2026-05-21 04:33:43 +00:00
parent 94e9467c30
commit 32d3517fa9
3 changed files with 21 additions and 2 deletions
+6
View File
@@ -143,8 +143,14 @@ export async function runGhCliPrContract(): Promise<JsonRecord> {
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 pr list")), "gh help should list pr list", { usage });
assertCondition(usage.some((line) => line.includes("gh pr read")), "gh help should list pr read", { usage });
assertCondition(usage.some((line) => line.includes("gh pr view")), "gh help should list pr view", { usage });
assertCondition(usage.some((line) => line.includes("gh pr create")), "gh help should list pr create", { usage });
assertCondition(usage.some((line) => line.includes("gh pr comment")), "gh help should list pr comment", { usage });
assertCondition(notes.some((line) => line.includes("canonical read path")), "gh help should state pr read is canonical", { notes });
assertCondition(notes.some((line) => line.includes("compatibility alias")), "gh help should state pr view is alias", { notes });
const mock = await startMockGitHub();
const env = {