updating tests

This commit is contained in:
Vallie Joseph
2024-04-08 17:21:24 +00:00
parent 67c383759c
commit 6e1d7543c4
2 changed files with 128 additions and 19 deletions

View File

@@ -43,8 +43,8 @@ export async function createZipUploadStream(
const zipUploadStream = new ZipUploadStream(bufferSize)
zip.pipe(zipUploadStream)
// register callbacks for various events during the zip lifecycle
zip.on('error', zipErrorCallback)
zip.on('warning', zipWarningCallback)
zip.on('error', zipErrorCallback)
zip.on('finish', zipFinishCallback)
zip.on('end', zipEndCallback)
@@ -75,23 +75,24 @@ export async function createZipUploadStream(
}
}
async.eachSeries(uploadSpecification, addFileToZip, (error: unknown) => {
if (error) {
core.error('Failed to add a file to the zip:')
core.info(error.toString()) // Convert error to string
return
}
zip.finalize() // Finalize the archive once all files have been added
return new Promise((resolve, reject) => {
async.eachSeries(uploadSpecification, addFileToZip, (error: unknown) => {
if (error) {
core.error('Failed to add a file to the zip:')
core.info(error.toString()) // Convert error to string
reject(error)
return
}
zip.finalize() // Finalize the archive once all files have been added
core.debug(
`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
)
core.debug(
`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
)
resolve(zipUploadStream)
})
})
core.debug(
`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`
)
core.debug(
`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`
)
return zipUploadStream
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any