formatting
This commit is contained in:
@@ -308,7 +308,7 @@ const testExponentialBackoffRunDelayAbortedWhenAbortSignal = async (): Promise<v
|
||||
try {
|
||||
let abort: (reason: unknown) => void;
|
||||
|
||||
const taskFn = vi.fn(async ({ stopRetries }) => {
|
||||
const taskFn = vi.fn(async ({ stopRetries }) => {
|
||||
abort = stopRetries;
|
||||
throw new Error('error message');
|
||||
});
|
||||
@@ -328,8 +328,7 @@ const testExponentialBackoffRunDelayAbortedWhenAbortSignal = async (): Promise<v
|
||||
throw new Error('abort is not defined');
|
||||
}
|
||||
|
||||
// Check that the rsult is still pending
|
||||
expect(result).not.resolves;
|
||||
// Check that the abort function is defined
|
||||
expect(abort).toBeDefined();
|
||||
|
||||
// Abort the exponential backoff
|
||||
@@ -337,11 +336,11 @@ const testExponentialBackoffRunDelayAbortedWhenAbortSignal = async (): Promise<v
|
||||
|
||||
// Expect the result to be rejected with an ExponentialBackoffStoppedRetriesError
|
||||
await expect(result).rejects.toThrow(ExponentialBackoffStoppedRetriesError);
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests the {@link ExponentialBackoff.from} factory and subsequent instance {@link ExponentialBackoff.run}
|
||||
* as an alternative to the static helper.
|
||||
@@ -629,7 +628,6 @@ const testExponentialBackoffValidateOptionsRejectsNaN = (): void => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** Tests that passing undefined into the constructor does not cause an error during spread */
|
||||
const testExponentialBackoffConstructorDoesNotCauseErrorDuringSpread = async (): Promise<void> => {
|
||||
const options = {
|
||||
|
||||
Reference in New Issue
Block a user