serverless / examples

Serverless Examples – A collection of boilerplates and examples of serverless architectures built with the Serverless Framework on AWS Lambda, Microsoft Azure, Google Cloud Functions, and more.
https://www.serverless.com/examples/
Other
11.43k stars 4.47k forks source link

Proposal: Add tests #158

Open kbariotis opened 7 years ago

kbariotis commented 7 years ago

I would suggest adding tests to each one of the examples. Testing is a big subject and lots of people that are interested in a serverless architecture may be wondering how one is being tested. Your recommendation on the subject will be a big deal, imho.

Thank you

ghost commented 7 years ago

I agree that it'd be nice to see some examples that include tests. That being said, everyone has a different approach to testing. Both in terms of libraries used, if any, and methodologies. While I feel that examples with tests would be helpful, the task should be approached with care and on the coat tails of a bit of discussion.

kbariotis commented 7 years ago

@darrenhgc absolutely. Serverless has already an official testing guide that could be a good starting point (I prefer a more functional approach). However, like you said, there are many solutions to the same problem so proper discussion is required.

ghost commented 7 years ago

I'm game. I think aws-node-twillio-send-text-message would be a good subject to base our conversation around. If anyone has a more suitable example in mind, your suggestions are welcome. I'd be willing to introduce some tests to the project after a bit of discussion. I'd be seeking input about directory structure and tooling. For reference about tooling, the serverless project is using chai, mocha, sinon and proxyquire.

ghost commented 7 years ago

Feedback encouraged for #160. Thanks in advance

leeeomaaax commented 7 years ago

@darrenhgc, nice work. Things I would also do:

leeeomaaax commented 7 years ago

@darrenhgc , now I'm trying to write tests using proxyquire to stub a s3.getObject, following the example here.

Saphyel commented 6 years ago

I think this is the most important feature they can provide...