This project shows a technique for testing an AWS Lambda using a mock AWS API Gateway, where there is an external API dependency.
Visit the GitHub repo for this pattern.
git clone https://github.com/aws-samples/serverless-patterns/ cd typescript-test-samples/apigw-lambda-external