can anyone please give me an example of how can I mock .then() block and .catch() block in Jest I am trying to test AWS cognito.signUp().then().catch() but returning TypeError: cognito.signUp(...).then(...).catch is not a function
The then and catch in this case are functions related to Promises. So what you probably want to do here is to mock the cognito.signUp function to return a promise.
You can find an example from here: https://jestjs.io/docs/tutorial-async