So this question was asked and there was an answer here: Is it possible to use TypeScript with 'aws-sdk-mock'
I don't have enough reputation to ask about the answer, so I had to create another question, because I couldn't get the answer to work.
Here's the entirety of my test code:
const AWSMock = require('aws-sdk-mock');
const AWS = require('aws-sdk');
AWSMock.setSDKInstance(AWS);
AWSMock.mock('DynamoDB', 'putItem', function (params, callback) {
console.log('MOCK WORKS!')
});
const ddb = new AWS.DynamoDB();
ddb.putItem(null, function(err, data) {
console.log('NOT MOCKED!')
});
AWSMock.restore();
Versions:
aws-sdk: 2.286.2
aws-sdk-mock: 4.0.0
Test framework: mocha 3.4.2
Any thoughts? Thanks!