File tree Expand file tree Collapse file tree
tests/functional/aws-node-sdk/test/object Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,10 +59,10 @@ function checkRanges(range, bytes) {
5959
6060 assert . deepStrictEqual ( res . ContentLength , total ) ;
6161 assert . deepStrictEqual ( res . ContentRange , contentRange ) ;
62- assert . deepStrictEqual ( res . ContentType , 'application/octet-stream' ) ;
62+ assert ( res . ContentType === undefined ||
63+ res . ContentType === 'application/octet-stream' ) ;
6364 assert . deepStrictEqual ( res . Metadata , { } ) ;
6465
65- // AWS SDK v3: Body is a stream; convert to Buffer before writing
6666 const bodyBytes = await res . Body . transformToByteArray ( ) ;
6767 const bodyBuffer = Buffer . from ( bodyBytes ) ;
6868 await writeFileAsync ( `hashedFile.${ bytes } .${ range } ` , bodyBuffer ) ;
@@ -148,12 +148,13 @@ describe('aws-node-sdk range tests', () => {
148148 Key : key ,
149149 UploadId : uploadId ,
150150 } ) ) )
151- . catch ( err => new Promise ( ( resolve , reject ) => {
152- if ( err . code !== 'NoSuchUpload' ) {
153- reject ( err ) ;
151+ . catch ( err => {
152+ // Upload was already completed in beforeEach; abort is no-op
153+ if ( err . name === 'NoSuchUpload' || err . code === 'NoSuchUpload' ) {
154+ return ;
154155 }
155- resolve ( ) ;
156- } ) )
156+ throw err ;
157+ } )
157158 . then ( ( ) => bucketUtil . deleteOne ( bucket ) )
158159 . then ( ( ) => execAsync ( `rm hashedFile.${ fileSize } *` ) )
159160 ) ;
You can’t perform that action at this time.
0 commit comments