Assuming that we already have Jenkins up and running, we need to install Node.js, and then we need to install Mocha on the Jenkins server for unit testing. After this, we need to install a serverless framework. You can use the Dockerfile (https://github.com/shzshi/aws-lambda-dynamodb-mytasks/blob/master/Dockerfile) from the aforementioned GitHub repository for Jenkins and serverless frameworks. If you are using Docker, you don't need to follow the steps for installing Node.js on Jenkins.
Go through the following steps to install Node.js on the Jenkins node:
$ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -$ sudo apt-get install -y nodejs$ sudo npm install -g serverless
Then go ...