aws-lambda-mock-context | AWS Lambda mock context object | Cloud Functions library
kandi X-RAY | aws-lambda-mock-context Summary
kandi X-RAY | aws-lambda-mock-context Summary
AWS Lambda mock context object
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of aws-lambda-mock-context
aws-lambda-mock-context Key Features
aws-lambda-mock-context Examples and Code Snippets
Community Discussions
Trending Discussions on aws-lambda-mock-context
QUESTION
I have a function in my Alexa skill's lambda function that I am trying to do a unit test for using the aws-lambda-mock-context
node package. The method I am trying to test includes a call to DynamoDB to check if an item exists in my table.
At the moment, my test immediately fails with CredentialsError: Missing credentials in config
. Following this blog, I tried to manually enter my Amazon IAM credentials into a .aws/credentials file. Testing with the credentials leads to the test running for 30+ seconds before timing out, with no success or fail result from DynamoDB. I am not sure where to go from here.
The function I am looking to unit test looks like this:
...ANSWER
Answered 2018-Feb-02 at 02:44if you want to do unit testing you can mock dynamo db endpoint using any mocking library like nock, also you can check fiddler request/ response what your app is making to dynamo db endpoint and then accordingly you can troubleshoot.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install aws-lambda-mock-context
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page