diff --git a/test/exponential-backoff.test.ts b/test/exponential-backoff.test.ts index e51cf73..d49137c 100644 --- a/test/exponential-backoff.test.ts +++ b/test/exponential-backoff.test.ts @@ -156,7 +156,7 @@ const testExponentialBackoffThrowsMaxRetriesHitErrorWhenExhausted = async (): Pr expect.fail('Expected ExponentialBackoffMaxRetriesHitError to be thrown'); } catch (error) { expect(error).toBeInstanceOf(ExponentialBackoffMaxRetriesHitError); - expect((error as ExponentialBackoffMaxRetriesHitError).cause).toEqual([firstError, lastError]); + expect((error as ExponentialBackoffMaxRetriesHitError).cause).toEqual([ firstError, lastError ]); } expect(fn).toHaveBeenCalledTimes(2); @@ -181,7 +181,7 @@ const testExponentialBackoffWrapsNonErrorThrows = async (): Promise => { expect.fail('Expected ExponentialBackoffMaxRetriesHitError to be thrown'); } catch (error) { expect(error).toBeInstanceOf(ExponentialBackoffMaxRetriesHitError); - const [wrappedError] = (error as ExponentialBackoffMaxRetriesHitError).cause as Error[]; + const [ wrappedError ] = (error as ExponentialBackoffMaxRetriesHitError).cause as Error[]; expect(wrappedError).toBeInstanceOf(Error); expect(wrappedError.message).toBe('not-an-error'); } @@ -355,7 +355,10 @@ const runTests = async (): Promise => { test('ExponentialBackoff: returns the result on first success', testExponentialBackoffSucceedsOnFirstAttempt); test('ExponentialBackoff: retries until the function succeeds', testExponentialBackoffRetriesUntilSuccess); test('ExponentialBackoff: calls onError for each failed attempt', testExponentialBackoffCallsOnErrorForEachFailure); - test('ExponentialBackoff: throws ExponentialBackoffMaxRetriesHitError when max attempts are exhausted', testExponentialBackoffThrowsMaxRetriesHitErrorWhenExhausted); + test( + 'ExponentialBackoff: throws ExponentialBackoffMaxRetriesHitError when max attempts are exhausted', + testExponentialBackoffThrowsMaxRetriesHitErrorWhenExhausted, + ); test('ExponentialBackoff: wraps non-Error throws before calling onError', testExponentialBackoffWrapsNonErrorThrows); test('ExponentialBackoff: works via from and instance run', testExponentialBackoffFromAndInstanceRun); test('ExponentialBackoff: retries indefinitely when maxAttempts is 0', testExponentialBackoffRetriesIndefinitelyWhenMaxAttemptsIsZero);