1
0
Fork 0

style change, refactor arg sequence

pull/661/head
Yang Cao 2020-12-04 09:41:00 -05:00
parent dc491a61ca
commit 5be846b72d
1 changed files with 6 additions and 6 deletions

View File

@ -124,7 +124,7 @@ describe('Download Tests', () => {
) )
const targetPath = path.join(root, 'FileA.txt') const targetPath = path.join(root, 'FileA.txt')
setupDownloadItemResponse(true, 200, false, fileContents, false) setupDownloadItemResponse(fileContents, true, 200, false, false)
const downloadHttpClient = new DownloadHttpClient() const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = [] const items: DownloadItem[] = []
@ -147,7 +147,7 @@ describe('Download Tests', () => {
) )
const targetPath = path.join(root, 'FileB.txt') const targetPath = path.join(root, 'FileB.txt')
setupDownloadItemResponse(false, 200, false, fileContents, false) setupDownloadItemResponse(fileContents, false, 200, false, false)
const downloadHttpClient = new DownloadHttpClient() const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = [] const items: DownloadItem[] = []
@ -171,7 +171,7 @@ describe('Download Tests', () => {
const fileContents = Buffer.from('try, try again\n', defaultEncoding) const fileContents = Buffer.from('try, try again\n', defaultEncoding)
const targetPath = path.join(root, `FileC-${statusCode}.txt`) const targetPath = path.join(root, `FileC-${statusCode}.txt`)
setupDownloadItemResponse(false, statusCode, false, fileContents, true) setupDownloadItemResponse(fileContents, false, statusCode, false, true)
const downloadHttpClient = new DownloadHttpClient() const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = [] const items: DownloadItem[] = []
@ -195,7 +195,7 @@ describe('Download Tests', () => {
) )
const targetPath = path.join(root, 'FileD.txt') const targetPath = path.join(root, 'FileD.txt')
setupDownloadItemResponse(true, 200, true, fileContents, true) setupDownloadItemResponse(fileContents, true, 200, true, true)
const downloadHttpClient = new DownloadHttpClient() const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = [] const items: DownloadItem[] = []
@ -218,7 +218,7 @@ describe('Download Tests', () => {
) )
const targetPath = path.join(root, 'FileE.txt') const targetPath = path.join(root, 'FileE.txt')
setupDownloadItemResponse(false, 200, true, fileContents, true) setupDownloadItemResponse(fileContents, false, 200, true, true)
const downloadHttpClient = new DownloadHttpClient() const downloadHttpClient = new DownloadHttpClient()
const items: DownloadItem[] = [] const items: DownloadItem[] = []
@ -297,10 +297,10 @@ describe('Download Tests', () => {
* @param firstHttpResponseCode the http response code that should be returned * @param firstHttpResponseCode the http response code that should be returned
*/ */
function setupDownloadItemResponse( function setupDownloadItemResponse(
fileContents: Buffer,
isGzip: boolean, isGzip: boolean,
firstHttpResponseCode: number, firstHttpResponseCode: number,
truncateFirstResponse: boolean, truncateFirstResponse: boolean,
fileContents: Buffer,
retryExpected: boolean retryExpected: boolean
): void { ): void {
const spyInstance = jest const spyInstance = jest