December 2019
Intermediate to advanced
382 pages
9h 43m
English
Now, let's move on to integration testing. This is an important step in the process that allows us to confirm that our code can work when it's deployed into an environment that is connected to all of the supporting infrastructure that the stack needs. This could be the API Gateway, IAM permissions, storage policies, other messaging systems, and databases. We need to make sure our lambda works as expected for our use case.
One way to integration test a Lambda function is to capture the invoking event by deploying the function and writing the event to the logs. You can then find the output in CloudWatch logs and save that to a JSON file. Use this file to invoke your integrated local function using serverless-offline. You ...