Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed May 19, 2022
1 parent 88c1f1b commit 71c54f6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/http/request.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,28 @@ describe('http.ServerRequest', function() {
});
});

describe('existing session, but not passing a callback argument', 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;
req.session = {};
req.session['passport'] = {};
req.session['passport'].user = '1';

it('should throw an exception', function() {
expect(function() {
req.logout();
}).to.throw(Error, 'req#logout requires a callback function');
});
});

});


Expand Down

0 comments on commit 71c54f6

Please sign in to comment.