-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ fix(core/test): wait for gateway to be closed cuz deno doesnt reall…
…y like events
- Loading branch information
1 parent
84f43e2
commit e0bf5f3
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Wait for a given amount of time. This is here because Deno test can't properly handle events. | ||
* @param ms The amount of time to wait in milliseconds. | ||
* @returns A promise that resolves after the given amount of time. | ||
*/ | ||
export const wait = async (ms: number = 1000): Promise<void> => { | ||
let id: number = 0; | ||
await new Promise((resolve) => id = setTimeout(resolve, ms)); | ||
clearTimeout(id); | ||
return; | ||
}; |