Amplify-js: jest test case to test Auth.currentSession()

Created on 8 Jul 2019  路  1Comment  路  Source: aws-amplify/amplify-js

* 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));
}

question

Most helpful comment

>All comments

Was this page helpful?
0 / 5 - 0 ratings