Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(client-s3): separate 200 response empty and error #3876

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Aug 23, 2022

Issue

Refs: #3874 (comment)

Description

Mocha has some issue with mocking response in S3 tests.

Testing

$ yarn run ts-mocha test/S3.spec.ts                       
yarn run v1.22.19
$ /local/home/trivikr/workspace/aws-sdk-js-v3/node_modules/.bin/ts-mocha test/S3.spec.ts


  endpoint
    ✔ users can override endpoint from client.

  Endpoints from ARN
    Accesspoint ARN
      ✔ should succeed with access point ARN
      ✔ should sign request with region from ARN is useArnRegion is set
    Outposts ARN
      ✔ should succeed with outposts ARN
    Object Lambda ARN
      ✔ should succeed with Object Lambda ARN
      ✔ should update endpoint of WriteGetObjectResponse command

  Throw 200 response
    when response body is empty
      ✔ should throw if CopyObject() return with 200 and empty payload
      ✔ should throw if UploadPartCopy() return with 200 and empty payload
      ✔ should throw if CompleteMultipartUpload() return with 200 and empty payload
    when response body is an error
      ✔ should throw if CopyObject() return with 200 and error preamble
      ✔ should throw if UploadPartCopy() return with 200 and error preamble
      ✔ should throw if CompleteMultipartUpload() return with 200 and error preamble

  regional endpoints
    ✔ should use regional endpoints if region is us-east-1
    ✔ should use global endpoints if region is aws-global


  14 passing (55ms)

Done in 0.79s.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr requested a review from a team as a code owner August 23, 2022 18:26
@trivikr trivikr merged commit 5668dae into aws:main Aug 23, 2022
@trivikr trivikr deleted the refactor-throw-200-response branch August 23, 2022 19:16
@github-actions
Copy link

github-actions bot commented Sep 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants