Easily mock aws-sdk API methods to enable easier testing of applications which use the AWS SDK for JavaScript
Questions tagged [aws-sdk-mock]
36 questions
0
votes
2 answers
How can I mock AWS Service Comprehend with Sinon, aws-sdk-mock?
I'm beginner with mocking in Typescript. I want to mock AWS.Comprehend in my unit test. I have this code with AWS Service Comprehend.
const comprehend = new AWS.Comprehend();
export const handler = async (): Promise => {
const params = {
…
0
votes
1 answer
Unit testing S3 getObject with aws-sdk-mock issue on unit test
I am writing a unit test for S3 getObject. I used aws-sdk-mock, but when I run it I get an issue.
Error: the object {
"error": "InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records."
"status": false
} was thrown,…

uday8486
- 1,203
- 2
- 13
- 22
0
votes
1 answer
aws-sdk-mock mocking an s3.putBucketPolicy does not work
I have this function which I want to test.
async function PutBucketPolicy(putBucketPolicyParams) {
logger.debug("---- PutBucketPolicy");
return new Promise(async(resolve, reject) => {
s3.putBucketPolicy(putBucketPolicyParams, function(err,…

Gulredy
- 107
- 1
- 3
- 10
0
votes
0 answers
mocking SQS with Jest
I am trying to mock SQS call defined in my file.js. It is a global instance in the file. So, while testing as I have to require file.js, its instance is set and my mock method is not called. However, if I set that SQS instance locally in the…

Utkarsh Vaish
- 48
- 1
- 10
0
votes
0 answers
Automated test cases for AWS using aws-sdk-mock
I am trying to test the automation of tagging and untagging of resources in AWS. This is very easy to do with the apis but i want to be able to do the same with aws-sdk-mock but i am having trouble understanding the documentation of aws-sdk-mock as…

Abdullah Farooq
- 133
- 2
- 9
0
votes
1 answer
aws-sdk-mock validate service ctor call SNS
I'm trying to validate that I supplied the correct arguments into the service ctor for SNS, but I don't know how to do it.
Now, I do know how to validate publish, but again, I'm trying to verify expectations for the SNS function/ctor.
Here's some…

KellyTheDev
- 891
- 2
- 12
- 31