aws-sdk-mock icon indicating copy to clipboard operation
aws-sdk-mock copied to clipboard

Is it possible to mock a service constructor

Open wheresrhys opened this issue 7 years ago • 1 comments

From the docs (and playing around a bit with the code) it looks like it's not possible to stub a constructor for a service. e.g. I only want to check which options are passed in to AWS.DynamoDB.

wheresrhys avatar May 11 '17 11:05 wheresrhys

Constructors are stubbed automatically, you can write assertions like this:

const AWS_SDK = require('aws-sdk');

sinon.assert.calledWith(AWS_SDK.DynamoDB, { apiVersion: '2012-08-10' });

modmac avatar Nov 29 '17 15:11 modmac