Open kbariotis opened 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.
@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.
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
.
Feedback encouraged for #160. Thanks in advance
@darrenhgc, nice work. Things I would also do:
package:
exclude:
- node_modules/**
- '!node_modules/twilio/**'
@darrenhgc , now I'm trying to write tests using proxyquire to stub a s3.getObject, following the example here.
I think this is the most important feature they can provide...
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