{"action":"opened","issue":{"url":"https://api.github.com/repos/dwyl/aws-sdk-mock/issues/60","repository_url":"https://api.github.com/repos/dwyl/aws-sdk-mock","labels_url":"https://api.github.com/repos/dwyl/aws-sdk-mock/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/dwyl/aws-sdk-mock/issues/60/comments","events_url":"https://api.github.com/repos/dwyl/aws-sdk-mock/issues/60/events","html_url":"https://github.com/dwyl/aws-sdk-mock/issues/60","id":194398666,"number":60,"title":"Provide more examples","user":{"login":"ifuyivara","id":132841,"avatar_url":"https://avatars.githubusercontent.com/u/132841?v=3","gravatar_id":"","url":"https://api.github.com/users/ifuyivara","html_url":"https://github.com/ifuyivara","followers_url":"https://api.github.com/users/ifuyivara/followers","following_url":"https://api.github.com/users/ifuyivara/following{/other_user}","gists_url":"https://api.github.com/users/ifuyivara/gists{/gist_id}","starred_url":"https://api.github.com/users/ifuyivara/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ifuyivara/subscriptions","organizations_url":"https://api.github.com/users/ifuyivara/orgs","repos_url":"https://api.github.com/users/ifuyivara/repos","events_url":"https://api.github.com/users/ifuyivara/events{/privacy}","received_events_url":"https://api.github.com/users/ifuyivara/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-08T17:39:06Z","updated_at":"2016-12-08T17:39:06Z","closed_at":null,"body":"I'm really trying to use this module to test our app. But I can't wrap my head around how to actually use it in a real scenario where I need to test some of the services our app is using. Here is what I'm doing:\r\n\r\n```\r\nvar AWSMock = require('aws-sdk-mock');\r\nconst Resolver = require('../services/resolver');\r\n\r\nAWSMock.mock('SQS', 'receiveMessage', function (params, callback){\r\n  callback(null, \"successfully received message\");\r\n});\r\n\r\nResolver.start();\r\n\r\nAWS.restore('SQS');\r\n```\r\n\r\nResolver.start is a function inside the resolver service that starts the AWS sdk like so:\r\n\r\n```\r\nvar AWS = require('aws-sdk');\r\nthis.sqs = options.sqs || new AWS.SQS({\r\n    region: options.region || 'eu-west-1'\r\n  });\r\nthis.sqs.receiveMessage(receiveParams, this._handleSqsResponseBound);\r\n```\r\n\r\nNothing gets mocked and my receiveMessage doesn't get called.\r\n\r\nI tried several things but just can't seem to get this to work. Am I ordering the includes wrong? "}}
{"actor":{"display_login":"ifuyivara"}}