chai-passport-strategy | testing Passport strategies with the Chai | Assertion library
kandi X-RAY | chai-passport-strategy Summary
kandi X-RAY | chai-passport-strategy Summary
Helpers for testing Passport strategies with the Chai assertion library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of chai-passport-strategy
chai-passport-strategy Key Features
chai-passport-strategy Examples and Code Snippets
Community Discussions
Trending Discussions on chai-passport-strategy
QUESTION
I'm building an app and as part of it, I have a REST API on Express that I would like to write integration tests for. I'm using "mocha" and "chai-http" to do this and it all works well aside from when I add authentication. So in a test like:
...ANSWER
Answered 2018-Feb-24 at 19:21The only solution to the problem I found is to use a mock passport authentication strategy for testing like this one: https://www.npmjs.com/package/passport-mocked And use that instead of your strategy when you are in a testing environment.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chai-passport-strategy
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page