mock-express-request-response
mock-express-request-response copied to clipboard
Error in Express testing guide referencing this example
Hi Hugo!
I thought your Express testing guide was great, but noticed a typo - right at the beginning on, you have:
const mockResponse = {
const res = {};
// replace the following () => res
// with your function stub/mock of choice
// making sure they still return `res`
res.status = () => res;
res.json = () => res;
return res;
};
This should, of course, be a function - as it is in your example.
Thanks again for the great guide! Very clear.