How to check the response from global fetch in JEST test case
问题 So, i am using jest for testing my node function which is calling fetch() APi to get the data, now when I am writing the test cases for the same i am getting an error like : expect(received).resolves.toEqual() Matcher error: received value must be a promise Received has type: function Received has value: [Function mockConstructor] my function : export function dataHandler (req, res, next) { const url= "someURL" if (url ) { return fetch(url ) .then((response) => response.json()) .then(