Added custom promise with timeout

This commit is contained in:
Sankalp Kotewar
2022-08-03 13:25:47 +00:00
parent 970264135a
commit 8be69a26ed
2 changed files with 30 additions and 16 deletions

View File

@@ -8,6 +8,7 @@ import {
const useAzureSdk = true
const downloadConcurrency = 8
const timeoutInMs = 30000
const abortTimeInMs = 2700000
const uploadConcurrency = 4
const uploadChunkSize = 32 * 1024 * 1024
@@ -17,7 +18,8 @@ test('getDownloadOptions sets defaults', async () => {
expect(actualOptions).toEqual({
useAzureSdk,
downloadConcurrency,
timeoutInMs
timeoutInMs,
abortTimeInMs
})
})
@@ -25,7 +27,8 @@ test('getDownloadOptions overrides all settings', async () => {
const expectedOptions: DownloadOptions = {
useAzureSdk: false,
downloadConcurrency: 14,
timeoutInMs: 20000
timeoutInMs: 20000,
abortTimeInMs: 2700000
}
const actualOptions = getDownloadOptions(expectedOptions)