Unable to mock node-fetch using fetch-mock
问题 I am trying to do unit testing for a simple function which sends a get request, receives a response and then returns a promise object with the success or the failure message. Following is the function: module.exports.hello = async (event, context) => { return new Promise((resolve, reject) => { fetch("https://httpstat.us/429", { headers: { 'Content-Type': 'application/json' } }).then(response => { console.log(response); if (response.status == 200) { return response; } else { throw Error