Skip to content

Commit

Permalink
style(retry): format code for better readability in tests and documen…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
faner11 committed Jan 3, 2025
1 parent cfadd0c commit 66a4fb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/function/retry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ describe('retry', () => {
});

it('When retries is 0, a fallback error is triggered', async () => {
expect(retry(getError, { intervalMs: 1000, retries: 0 })).rejects.toThrowError(new Error('Failed after maximum retries'));
expect(retry(getError, { intervalMs: 1000, retries: 0 })).rejects.toThrowError(
new Error('Failed after maximum retries')
);
});
});
4 changes: 2 additions & 2 deletions src/function/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ interface RetryOptions {
* @returns {Awaited<ReturnType<F>>} - Function return value
* @throws {Error} - Throws an error if the maximum number of retries is exceeded.
* @example
*
* async function getNumber() {
*
* async function getNumber() {
* return Promise.resolve(3);
* }
* async function getError() {
Expand Down

0 comments on commit 66a4fb0

Please sign in to comment.