Skip to content

Commit

Permalink
fix(test): resolve promises
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 27, 2024
1 parent 6e067f7 commit 1d62274
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/get-activity.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { config } from "dotenv";
import { GetActivity } from "./get-activity";
import { parseGitHubUrl } from "./start";
import { config } from "dotenv";

config();
const GITHUB_TOKEN = process.env.GITHUB_TOKEN;
Expand All @@ -11,13 +11,20 @@ if (!GITHUB_TOKEN) {
process.argv = ["path/to/node", "path/to/script", `--auth=${GITHUB_TOKEN}`];

describe("GetActivity class", () => {
let activity: GetActivity;
const issue22 = parseGitHubUrl("https://github.com/ubiquibot/comment-incentives/issues/22");
const activity = new GetActivity(issue22);

beforeAll(async () => {
const issue22 = parseGitHubUrl("https://github.com/ubiquibot/comment-incentives/issues/22");
activity = new GetActivity(issue22);
await activity.init();
console.dir(activity, { depth: null, colors: true });
});

it("should resolve all promises", async () => {
await activity.init();

expect(activity.self).toBeTruthy();
expect(activity.events).toBeTruthy();
expect(activity.comments).toBeTruthy();
expect(Array.isArray(activity.linkedReviews)).toBeTruthy();
});

it("should create an instance of GetActivity", () => {
Expand Down

0 comments on commit 1d62274

Please sign in to comment.