jest-mock-aws
Utiliy to help you mock AWS when testing with Jest.
You can use this only with the AWS Promise interface.
Quick start
npm install --save-dev jest-mock-aws
index.js
exports ;
index.test.js
const AWS = ;const mockAwsServiceMethod = ; jest; ;
API
mockAwsService
mockAwsService(AWS:object, serviceName:string) :object
const AWS = {};const mockSns = ;mockSnspublish = jest;mockSnspublish;
mockAwsServiceMethod
mockAwsServiceMethod(AWS:object, serviceName:string, methodName:String) :jest.fn()
const AWS = {};const mockSnsPublish = ;mockSnsPublish;
mockAwsServiceMethods
mockAwsServiceMethods(AWS:object, serviceName:string, methods:Array|Object) :object
With Array.
const AWS = {};const mockSqs = ;mockSqsdeleteMessage;mockSqsreceiveMessages;
With Object.
const AWS = {};const mockSqs = ;