aws-sdk-mock icon indicating copy to clipboard operation
aws-sdk-mock copied to clipboard

in Cognito is posible to mock userPool.signup method?

Open ivanhuay opened this issue 7 years ago • 8 comments

I am trying to perform e2e test but I can't mock cognito in any way.

I had thought to mock the methods signup and login but as they are part of the CognitoUserPool object I am not sure how to do it.

i'm using the oficial library https://github.com/aws/amazon-cognito-identity-js

ivanhuay avatar Jul 10 '17 19:07 ivanhuay

same issue !!

paradelapilar avatar Jul 11 '17 14:07 paradelapilar

same issue !!

brian91dd avatar Jul 11 '17 14:07 brian91dd

Same problem here!! Im really stuck with this issue, thanks.

Lucasq95 avatar Jul 11 '17 14:07 Lucasq95

same issue !!

matias22x avatar Jul 11 '17 14:07 matias22x

any solution on these?

stephen1706 avatar Mar 21 '18 09:03 stephen1706

+1 here

jjaburke91 avatar Jun 08 '18 09:06 jjaburke91

Any solution? 2021

movaldivia avatar Jan 25 '21 15:01 movaldivia

I have mocked Cognito signup and seems to work fine, hope it can help others. The problem is after a few times tests start to throw the following error:

LimitExceededException: Exceeded daily email limit for the operation or the account. If a higher limit is required, please configure your user pool to use your own Amazon SES configuration for sending email.

Can anybody help with this?

Thanks

import AWS from "aws-sdk-mock"; AWS.mock( "CognitoIdentityServiceProvider", "signUp", ( { email: TEST_EMAIL, password: TEST_PASSWORD, attributeList: [] }, callback ) => { callback(null, true); } ); const result: boolean = await signup(cognitoUserRepository)( TEST_EMAIL, TEST_PASSWORD ); expect(result).toBeTruthy();

alberdg81 avatar Oct 15 '21 06:10 alberdg81