summaryrefslogtreecommitdiff
path: root/cgithub/src/scraper.test.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-05-27 14:02:36 -0400
committerJoe Mou <dev@mou.fo>2026-05-27 23:37:23 -0400
commitc57123139794c3ef174b62c6bd2a54a60bbf3327 (patch)
treedfa27f2843efd30b2fab6ae65abd233ee488e69d /cgithub/src/scraper.test.ts
parent123da65350888dc0fbe04003c5ffc36fdded3a46 (diff)
Add repo-scoped search support for issues and PRs
We do not support hybrid issue/PR search. Any searches on the issues endpoint will redirect to an explicit issue-only search.
Diffstat (limited to 'cgithub/src/scraper.test.ts')
-rw-r--r--cgithub/src/scraper.test.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/cgithub/src/scraper.test.ts b/cgithub/src/scraper.test.ts
index 42ddd6e..236b0f5 100644
--- a/cgithub/src/scraper.test.ts
+++ b/cgithub/src/scraper.test.ts
@@ -127,6 +127,7 @@ describe("GitHub scraper", () => {
assert.strictEqual(data.repo.owner, "actions");
assert.strictEqual(data.repo.name, "deploy-pages");
+ assert.strictEqual(data.q, undefined);
const issue402 = data.issues.find((issue) => issue.number === 402);
assert.ok(issue402);
@@ -135,6 +136,20 @@ describe("GitHub scraper", () => {
assert.strictEqual(issue402.createdAt, "2025-07-03T19:07:08Z");
});
+ it("should fetch filtered issues with q", async () => {
+ const data = await getGitHubIssues("actions", "deploy-pages", {
+ q: "is:issue state:closed",
+ });
+
+ assert.strictEqual(data.repo.owner, "actions");
+ assert.strictEqual(data.repo.name, "deploy-pages");
+ assert.strictEqual(data.q, "is:issue state:closed");
+ const issue417 = data.issues.find((issue) => issue.number === 417);
+ assert.ok(issue417);
+ assert.strictEqual(issue417.title, "Chats");
+ assert.ok(data.issues.every((issue) => issue.title !== ""));
+ });
+
it("should fetch commits", async () => {
const data = await getGitHubCommits("actions", "deploy-pages", "main", "");