aws-sdk-mock
aws-sdk-mock copied to clipboard
in Cognito is posible to mock userPool.signup method?
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
same issue !!
same issue !!
Same problem here!! Im really stuck with this issue, thanks.
same issue !!
any solution on these?
+1 here
Any solution? 2021
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();