Monday 22 May 2017

AWS Lambda - Node.js - Automated Testing

I have been given a codebase built entirely in AWS Lambda (Using the serverless framework). I am trying now to setup a test suite in order to get to know the codebase and to be able to safely make changes. But Im having a hard time with AWS's SDK for Javascript. It doesn't seem to be able to be mocked.What I need is to isolate the codebase from other AWS services like S3 and DynamoDB. Sinon and the (one and only) aws-sdk-mock packages doesn seem to work. I was wondering how did you structured your codebase to be able to be tested. Were you injecting an aws-sdk instance in each function? Were you even doing such testing locally?Thank you

Submitted May 22, 2017 at 03:16PM by kostarelo

No comments:

Post a Comment