I am using the local strategy of Passport.js to authenticate users for my API. I am writing tests for this API, and I need a way of mocking Passport.js in the tests to simulate
you can use the http request objects in node and automate rest requests against your API the same way as it would occur in the real world. Look at node supertest module.