Monday, 25 November 2019

How to write test cases for express routes?

Hi, I have an express route like this :app.get('api", firstStep, secondStep, thirdStep);function firstStep(req,res,next) {//some async worknext();}Now I want to write unit test case for only firstStep and secondStep. The problem is how do I tell mocha/chai to wait for async task to being finished and how do I tell it that after firstStep is done it needs to go on secondStep.

Submitted November 25, 2019 at 01:18PM by GhostFoxGod

No comments:

Post a Comment