aboutsummaryrefslogtreecommitdiff
path: root/src/scraper.test.ts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-01-27 15:05:36 -0500
committerJoe Mou <dev@mou.fo>2026-01-27 17:21:45 -0500
commit200defaa5c769b4603f9256e943821344cadbe82 (patch)
treec66bc43948d8accf8cd2d5462c6115c8cc238ca7 /src/scraper.test.ts
parent8fec0b99fbe193326d25fc107e0c625dcf05fd12 (diff)
List issues
Diffstat (limited to 'src/scraper.test.ts')
-rw-r--r--src/scraper.test.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/scraper.test.ts b/src/scraper.test.ts
index adf70ae..e7e65ba 100644
--- a/src/scraper.test.ts
+++ b/src/scraper.test.ts
@@ -1,6 +1,12 @@
import assert from "node:assert";
import { describe, it } from "node:test";
-import { getGitHubBlob, getGitHubRepo, getGitHubTree, GitHubHTTPError } from "./scraper.ts";
+import {
+ getGitHubBlob,
+ getGitHubIssues,
+ getGitHubRepo,
+ getGitHubTree,
+ GitHubHTTPError,
+} from "./scraper.ts";
describe("GitHub scraper", () => {
describe("actions/deploy-pages repository", () => {
@@ -66,6 +72,19 @@ describe("GitHub scraper", () => {
assert.match(data.rawContent, /^MIT License\n\n/);
assert.match(data.content, /^MIT License\n\n/);
});
+
+ it("should fetch issues", async () => {
+ const data = await getGitHubIssues("actions", "deploy-pages");
+
+ assert.strictEqual(data.repo.owner, "actions");
+ assert.strictEqual(data.repo.name, "deploy-pages");
+
+ const issue402 = data.issues.find((issue) => issue.number === 402);
+ assert.ok(issue402);
+ assert.strictEqual(issue402.title, "Dry Run");
+ assert.strictEqual(issue402.state, "OPEN");
+ assert.strictEqual(issue402.createdAt, "2025-07-03T19:07:08Z");
+ });
});
describe("error handling", () => {