MCPcopy Create free account
hub / github.com/cli/cli / expect

Function expect

evals/src/suites/events/smoke-protocol.ts:42–46  ·  view source on GitHub ↗
(args: string[])

Source from the content-addressed store, hash-verified

40 */
41export async function runSubscriptionCommands(gh: GhRunner, prUrl: string): Promise<string> {
42 const expect = async (args: string[]) => {
43 const result = await gh(args);
44 if (result.code !== 0) throw new Error(`gh ${args.join(" ")} exited ${result.code}: ${result.stderr.trim()}`);
45 return result.stdout;
46 };
47 const type = "com.github.pull_request.merge_conflict.v1";
48 const id = (await expect(["event", "subscription", "create", "--resource", prUrl, "--event", type])).trim();
49 if (!/^sub_[A-Za-z0-9]+$/.test(id)) throw new Error(`gh event subscription create printed no subscription ID: ${id}`);

Callers 1

runSubscriptionCommandsFunction · 0.85

Calls 1

ghFunction · 0.85

Tested by

no test coverage detected