mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-11-29 03:15:39 +01:00
chore: add initial tests
This commit is contained in:
8 files changed
+923
-535
No files matched your search
+9
-1
@@ -38,9 +38,17 @@ export function isDefined<T>(i: T | undefined | null): i is T {
|
||||
return i !== undefined && i !== null;
|
||||
}
|
||||
|
||||
function sleep(ms: number) {
|
||||
function defaultSleep(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
let sleep = defaultSleep;
|
||||
|
||||
export function withsleep(s: typeof sleep) {
|
||||
sleep = s;
|
||||
}
|
||||
export function reset() {
|
||||
sleep = defaultSleep;
|
||||
}
|
||||
|
||||
// retryAndBackoff retries with exponential backoff the promise if the error isRetryable upto maxRetries time.
|
||||
export async function retryAndBackoff<T>(
|
||||
|
||||
Reference in new issue
Block a user