1
0
Fork 0

pipeResponseToFile already throws when reading truncated stream

pull/661/head
Yang Cao 2020-12-04 09:19:58 -05:00
parent a600dd34a5
commit dc491a61ca
1 changed files with 0 additions and 13 deletions

View File

@ -196,7 +196,6 @@ describe('Download Tests', () => {
const targetPath = path.join(root, 'FileD.txt')
setupDownloadItemResponse(true, 200, true, fileContents, true)
setupThrowWhenReadingStream()
const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = []
@ -292,18 +291,6 @@ describe('Download Tests', () => {
})
}
function setupThrowWhenReadingStream(): void {
jest
.spyOn(DownloadHttpClient.prototype, 'pipeResponseToFile')
.mockImplementationOnce(async () => {
return new Promise<void>(() => {
throw new Error(
'simulate GZip reading truncated buffer and throw Z_BUF_ERROR'
)
})
})
}
/**
* Setups up HTTP GET response for downloading items
* @param isGzip is the downloaded item gzip encoded