/serverless-testing

Unit Testing with Serverless Framework and Jest

Primary LanguageJavaScriptMIT LicenseMIT

Serverless Testing

Software Testing is a key part of any application development irrespective of the tools, frameworks or methodologies in use. This simple project is created to put up few examples on how to create Unit tests for Lambda functions using the Jest and other libraries.

Run the following command to run unit tests. For unit testing, update the .env with AWS region and Lambda Endpoint to local offline endpoint. Refer the sample.env file for the required environment variables.

npm test

For initgration testing, make sure the project is deployed to AWS account. Update the .env with AWS region and API Gateway Endpoint. Refer the sample.env file for the required environment variables.

npm run test-integration

References