Skip to content

Conversation

theburningmonk
Copy link
Collaborator

Closes #9

Besides adding support for S3 I made some small changes as well:

  • added 500 to method response and integration response
  • made some of the internal methods synchronous when they don't need to be async - e.g. getKinesisMethodIntegration and getMethodResponses

@erezrokah
Copy link
Collaborator

Sorry for the self promoting, but I wrote a library that might help with the integration tests.

You can assert an S3 object, and delete objects as well.

e.g.

const { default: awsTesting } = require('aws-testing-library/lib/chai')
const chai = require('chai')
chai.use(awsTesting)
const { expect } = chai
const { clearAllObjects } = require('aws-testing-library/lib/utils/s3')

  afterAll(async () => {
    await clearAllObjects('us-east-1', bucket)
    removeService(stage, config)
  })

  it('should get correct response from s3 put endpoint', async () => {
    // test setup, act

    // test assert
    await expect({
      region: 'us-east-1',
      bucket,
      timeout: 0,
      pollEvery: 0
    }).to.have.object(key, Buffer.from(JSON.stringify({ message: 'test' })))
  })

  it('should get correct response from s3 delete endpoint', async () => {
    // test setup, act

    // test assert
    await expect({
      region: 'us-east-1',
      bucket,
      timeout: 0,
      pollEvery: 0
    }).to.not.have.object(key)
  })

@horike37
Copy link
Collaborator

@theburningmonk
Great! Thank you for adding this new proxy 👍
Can you also add the explanation of this to README?

@theburningmonk
Copy link
Collaborator Author

@horike37 of course, I was just thinking that I forgot to update README on all my PRs yesterday!

@theburningmonk
Copy link
Collaborator Author

@erezrokah thanks for the offer, but I'm not doing too much with the AWS SDK in this project so I'd rather not bring in another library for now. I'll check it out for future projects/PRs.

@theburningmonk
Copy link
Collaborator Author

@horike37 done, README updated

Copy link
Collaborator

@horike37 horike37 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theburningmonk
Thanks for updating! Great to see working fine 👍
LGTM.

@horike37 horike37 merged commit 84bdc00 into serverless-operations:master Aug 19, 2019
@horike37
Copy link
Collaborator

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add support for S3
3 participants