diff options
| author | Joe Mou <dev@mou.fo> | 2026-01-27 15:05:36 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2026-01-27 17:21:45 -0500 |
| commit | d29bdad2f5c8326d111901373f0a56b3a09a2cd8 (patch) | |
| tree | a34128312316849e257bde7750c2e01180a77f3c /cgithub/src/scraper.test.ts | |
| parent | 64c397e256b01a2e542e84529e947e237c07edd6 (diff) | |
List issues
Diffstat (limited to 'cgithub/src/scraper.test.ts')
| -rw-r--r-- | cgithub/src/scraper.test.ts | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/cgithub/src/scraper.test.ts b/cgithub/src/scraper.test.ts index adf70ae..e7e65ba 100644 --- a/cgithub/src/scraper.test.ts +++ b/cgithub/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", () => { |
