Tags: sinon

NodeJS - Unit Test DynamoDB

May 10, 2019 2 min.

Introduction This page explains how to mock dynamodb client using Sinon and Proxyqurie Required dependencies Install the following dependencies npm install --save-dev sinon npm install --save-dev proxyquire Sample Project Setup a sample project # Create a sample project directory mkdir myproject cd myproject # Initalize npm npm init -y # Install project dependencies npm install aws-sdk # Install Unit test framework globally (if you have not already installed) npm install -g mocha # Install Test dependencies npm install --save-dev sinon npm install --save-dev proxyquire create a index.