From 8f05cccf8e267aaac0b304da509f58c449cf033a Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Thu, 3 Dec 2020 10:33:10 -0500 Subject: [PATCH] Fix styling --- __tests__/download.test.ts | 4 ++-- src/internal/download-http-client.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/__tests__/download.test.ts b/__tests__/download.test.ts index 518cfc5..b940fde 100644 --- a/__tests__/download.test.ts +++ b/__tests__/download.test.ts @@ -293,10 +293,10 @@ describe('Download Tests', () => { } function setupThrowWhenReadingStream(): void { - const spyInstance = jest + jest .spyOn(DownloadHttpClient.prototype, 'pipeResponseToFile') .mockImplementationOnce(async () => { - return new Promise(resolve => { + return new Promise(() => { throw new Error( 'simulate GZip reading truncated buffer and throw Z_BUF_ERROR' ) diff --git a/src/internal/download-http-client.ts b/src/internal/download-http-client.ts index 2110b6a..7caef99 100644 --- a/src/internal/download-http-client.ts +++ b/src/internal/download-http-client.ts @@ -219,7 +219,9 @@ export class DownloadHttpClient { return parseInt(expected) === received } - const resetDestinationStream = async (downloadPath: string) => { + const resetDestinationStream = async ( + downloadPath: string + ): Promise => { await rmFile(downloadPath) destinationStream = fs.createWriteStream(downloadPath) }