From dc491a61cae3e56f9b7abdc98b1aed54b3c3cb69 Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Fri, 4 Dec 2020 09:19:58 -0500 Subject: [PATCH] pipeResponseToFile already throws when reading truncated stream --- packages/artifact/__tests__/download.test.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/packages/artifact/__tests__/download.test.ts b/packages/artifact/__tests__/download.test.ts index b940fdec..ec07a1fe 100644 --- a/packages/artifact/__tests__/download.test.ts +++ b/packages/artifact/__tests__/download.test.ts @@ -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(() => { - 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