Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call passport.authenticate so that it will always be true #1

Open
manuel114 opened this issue Sep 27, 2019 · 0 comments
Open

Comments

@manuel114
Copy link

Hello, im trying to call passport.authenticate with the mockstrategy in a unit test so that I will be able to call a function that currently checks for req.user (normally it would get it through a cookie).

I have used:
const passportMock = createMockPassport(app);
setupSerializeAndDeserialize(passportMock, null, null);
connectPassport(app, passportMock);

But I don't really know what to call on my test so that the authentification of a custom user object will be succesful and req.login(user) is called.

Thank you in advanced!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant