-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-gh.ts
More file actions
29 lines (25 loc) · 997 Bytes
/
test-gh.ts
File metadata and controls
29 lines (25 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { readRepoInfo, get_gh_client } from "./.along/bin/github-client.ts";
async function test() {
console.log("Testing readRepoInfo...");
const repoRes = await readRepoInfo();
console.log("Repo Info:", JSON.stringify(repoRes, null, 2));
if (repoRes.success) {
console.log("Testing get_gh_client...");
const clientRes = await get_gh_client();
if (clientRes.success) {
console.log("Client created successfully.");
const client = clientRes.data;
console.log("Client owns:", (client as any).owner, (client as any).repo);
// Try a real API call if possible, otherwise just check properties
try {
const details = await client.getRepositoryDetails();
console.log("Repository Details fetched successfully:", details.full_name);
} catch (e) {
console.error("Failed to fetch repository details:", e);
}
} else {
console.error("Failed to create client:", clientRes.error);
}
}
}
test();