-
Notifications
You must be signed in to change notification settings - Fork 47
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 stub liana.ensureAuthenticated? #219
Comments
seems to be a broader issue with stubbing express app middleware before app gets loaded. https://stackoverflow.com/questions/41995464/how-to-mock-middleware-in-express-to-skip-authentication-for-unit-test ended up resolving this by not including |
Could you provide your working example? |
Expected behavior
sinon.stub(liana, 'ensureAuthenticated') should stub the ensureAuthenticated
Actual behavior
stub does not address liana 'ensureAuthenticated', and code in
forest-express-sequelize
andforest-express
seem to obscure how ensureAuthenticated is exposedContext
I use
liana.ensureAuthenticated
as a middleware as suggested by Forest docs https://doc.forestadmin.com/developer-guide/express-sequelize.html#uploading-images and am hoping to unit test my controller.The text was updated successfully, but these errors were encountered: