Skip to content

Commit

Permalink
feat(testing): add delay function
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Nov 1, 2023
1 parent b7dbc68 commit 9d8cd81
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/testing/src/delay.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Will complete after a time delay
*
* @example
* it('Test', async () => {
* await delay(100);
* });
*/
export const delay = (ms?: number): Promise<void> => new Promise(res => setTimeout(res, ms ?? 0));

0 comments on commit 9d8cd81

Please sign in to comment.