Testing Authenticated Routes With Jwt Fails Using Mocha + Supertest + Passport
I'm trying to test authenticated routes in Mocha but the user created in before or beforeEach hooks does not persist. In test.js const should = require('chai').should(), mongoo
Solution 1:
You need to use Authorization header with the Bearer authentication scheme:
.set('Authorization', 'Bearer ' + jwtToken)
Post a Comment for "Testing Authenticated Routes With Jwt Fails Using Mocha + Supertest + Passport"