* AWS-Amplify *
* Cognito User Pool*
*I want to test the aws-amplify library (Auth.currentSession()) method which required to configure mock CognitoUserPool and current session *
Below is my Code and need to write a jest test.
function getIdToken() {
return Auth.currentSession()
.then(data => {
return data.getIdToken().getJwtToken();
})
.catch(err => console.log(err));
}
Hi @jani937
This is how one of our tests do it:
Hope that helps!
Most helpful comment
Hi @jani937
This is how one of our tests do it:
https://github.com/aws-amplify/amplify-js/blob/d384e5dd01b2719111c5121538259571730b1218/packages/api/__tests__/API-test.ts#L645-L649
Hope that helps!