dwyl/aws-sdk-mock

Not able to mock SQS,S3 or any other AWS Component

tkskumar opened this issue · 1 comments

const AWSMock = require("aws-sdk-mock");
const AWS =  require("aws-sdk"); 

describe ("Mock invocation tests ", () => {
    it ("Should invoke the lambda", async () => {
        AWSMock.setSDKInstance(AWS);
        AWSMock.mock('Lambda', 'invoke', (params, cb) => {
            console.log("mock called", params);            
            cb(null, "hello");
        });    
    });
}); 

message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1',
errno: -113,
code: 'CredentialsError',
syscall: 'connect',

creating aws profile fix my issue