aws-sdk-mock
aws-sdk-mock copied to clipboard
Mock failing when using with aws-sdk 2.422.0
When using aws-sdk 2.307.0 for aws-sdk-mock 4.3.1 below worked successfully.
const AWSMock = require('aws-sdk-mock');
const AWS = require('aws-sdk');
AWSMock.setSDKInstance(AWS);
AWSMock.mock('DynamoDB.DocumentClient', 'update', function (params, callback) {
callback(null, {
Item: { Key: 'SomeDummyValue' }, ConsumedCapacity: 2, Attributes: {
someId: 60}
});
});
However on changing aws-sdk to latest version of today - 2.422.0, above failed and direct call to DynamoDB is being made