Open tomdavidson opened 8 years ago
Did you solve this? Did the dev ever respond?
I think the problem is, that you restore the mock before the test function is called, as this is done asynchronously.
Does your test framework support before and after methods? That would be the place to mock and restore.
Solved it. I was using an SQS Consumer lib and in that lib there was a call to Request.send
. Solution:
const requestSend = sinon.stub();
AWSMock.mock("Request", "send", requestSend);
Trying out basic use of tape and aws-sdk-mock but am not able to mock aws. I am initialling the AWS service in the function:
my attempt to mock sns publish:
which fails over creds:
Seems straightforward, but I am at a loss.