Skip to content

Commit

Permalink
Merge pull request #984 from tsg-ut/pwnyaa-await-in-unit-test-only
Browse files Browse the repository at this point in the history
pwnyaa: Await for initialization only in unit test
  • Loading branch information
hakatashi authored Feb 11, 2025
2 parents fa9978a + fd06e99 commit 4646beb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pwnyaa/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ beforeEach(async () => {
await fs.writeFile(stateOriginalPath, JSON.stringify(fakeState));

jest.useFakeTimers();
await pwnyaa(slack);
const {initPromise} = await pwnyaa(slack);

await initPromise;
});


Expand Down
4 changes: 3 additions & 1 deletion pwnyaa/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -997,5 +997,7 @@ export default async ({eventClient, webClient: slack}: SlackInterface) => {
});

// init
await updateAll();
const initPromise = updateAll();

return {initPromise};
};

0 comments on commit 4646beb

Please sign in to comment.