Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed May 19, 2022
1 parent c1991cf commit 8825a9a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/http/request.test.js
Expand Up @@ -824,6 +824,33 @@ describe('http.ServerRequest', function() {
});
});

describe('without session support', function() {
var passport = new Passport();
passport.serializeUser(function(user, done) {
done(null, user.id);
});

var req = new Object();
req.logout = request.logout;
req._passport = {};
req._passport.instance = passport;
req._sessionManager = passport._sm;

var error;

before(function(done) {
req.logout(function(err) {
error = err;
done();
});
});

it('should error', function() {
expect(error).to.be.an.instanceOf(Error);
expect(error.message).to.equal('Login sessions require session support. Did you forget to use `express-session` middleware?');
});
});

});


Expand Down

0 comments on commit 8825a9a

Please sign in to comment.