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

Function route

evals/src/graders.test.ts:222–229  ·  view source on GitHub ↗
(resource: string, ...extra: string[])

Source from the content-addressed store, hash-verified

220
221test("a listener bound by a REST API pull request URL counts as bound to the fixture PR", async () => {
222 const route = (resource: string, ...extra: string[]) => {
223 const context = evidence();
224 context.snapshot.pr!.base = { ref: "main", repo: { id: 42 } };
225 const output = extra.length ? [{ at: 15, stream: "stdout" as const, text: "7\n" }] : [stream()];
226 context.calls = [{ ...wait(), arguments: ["event", "listen", "--resource", resource, "--event", "review", ...extra],
227 output }];
228 return new EventRouteGrader(fixed(context)).grade({ trajectory });
229 };
230 assert.equal((await route("https://api.github.com/repos/sandbox/run/pulls/1")).passed, true);
231 assert.equal((await route("https://api.github.com/repositories/42/pulls/1")).passed, true);
232 assert.equal((await route("https://api.github.com/repos/sandbox/run/pulls/1", "--jq", ".id")).passed, true);

Callers 1

graders.test.tsFile · 0.85

Calls 5

evidenceFunction · 0.85
fixedFunction · 0.85
streamFunction · 0.70
waitFunction · 0.70
gradeMethod · 0.45

Tested by

no test coverage detected