Let's perform the following steps to see how to unit test a Lambda function:
- First, let's create a new serverless project by running the following command:
serverless create --template aws-nodejs --name testing
- Now, let's modify the serverless.yml file to the following:
service: testing-service provider: name: aws runtime: nodejs6.10 functions: hello: handler: functions/greetings.hello
- In this ...