Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Murderlon committed Jan 14, 2025
1 parent 4ef4c82 commit 779f9a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,16 +278,17 @@ export class HTTPCommunicationQueue<M extends Meta, B extends Body> {

const key = fields?.key
if (!key) {
throw new Error(
console.error(

Check warning on line 281 in packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts

View workflow job for this annotation

GitHub Actions / Lint JavaScript/TypeScript

Unexpected console statement
'Expected `fields.key` to be returend but the backend/Companion',
)
}
this.#setS3MultipartState(file, { key })
this.#setS3MultipartState(file, { key: key! })

return {
...result,
location: removeMetadataFromURL(url),
bucket: fields.bucket,
location:
(result.location as string | undefined) ?? removeMetadataFromURL(url),
bucket: fields?.bucket,
key,
}
}
Expand Down
7 changes: 6 additions & 1 deletion packages/@uppy/aws-s3/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ describe('AwsS3Multipart', () => {
getUploadParameters: () => ({
method: 'POST',
url: 'https://bucket.s3.us-east-2.amazonaws.com/',
fields: {},
fields: {
key: 'file',
bucket: 'https://bucket.s3.us-east-2.amazonaws.com/',
},
}),
})
const scope = nock(
Expand Down Expand Up @@ -89,6 +92,8 @@ describe('AwsS3Multipart', () => {
ETag: 'test',
etag: 'test',
location: 'http://example.com',
key: 'file',
bucket: 'https://bucket.s3.us-east-2.amazonaws.com/',
},
status: 200,
uploadURL: 'http://example.com',
Expand Down

0 comments on commit 779f9a5

Please sign in to comment.