How it works...

Integration testing uses all of the same tools that are used for unit testing, plus some additional tools. This is an advantage in that the learning curve is incremental. The first new tool of interest is the serverless-offline plugin. This plugin reads the serverless.yml file and simulates the API Gateway locally to facilitate the testing of synchronous APIs. Next, we use supertest to make HTTP calls to the locally-running service and assert the responses. Inevitably, these services make calls to AWS services using the default or specified access key. These are the calls that we want to record and playback in the CI/CD pipeline. baton-vcr-serverless-plugin initializes the Replay VCR library in the serverless-offline process. ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.