Thursday, 3 January 2019

Mocha testing authenticated routes

Hi, I am testing my routes using mocha and chai-http. Some of my routes send a different response based on whether the user is logged in. I use passport for my authentication, which means the logged in user is stored in req.user.I would like to run 2 test on a route, one when the user is logged in and the other when the user is logged out. How can i achieve that? Thanks in advance ;)

Submitted January 03, 2019 at 05:22PM by everek123

No comments:

Post a Comment