Suppose I have the following route:
router.get('/users', controller.authenticate, controller.generateList, controller.sendList);
I now want to test each function controller.authenticate, .generateList, .sendList
separately.
I've seen posts that claim supertest can do this, but I fail to see how.
EDIT
The duplicate post marked for this is not what I'm looking for at all. That post talks about how to wrap the middlewares into one function, and I want to do the exact reverse. I want to keep each middleware separate, and test EACH middleware completely independent of the other one. I will mock the data of that the middleware would need.