Skip to content

Commit

Permalink
Add test and fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Hathcock committed Oct 29, 2018
1 parent 579b9cb commit d2d88c7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/authenticator.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,10 @@ Authenticator.prototype.session = function session(options) {
* @api public
*/

Authenticator.prototype.sessionManager = function(mgr) {
Authenticator.prototype.sessionManager = function sessionManager(mgr) {
this._sm = mgr;
return this;
}

};

/**
* Registers a function used to serialize user objects into the session.
Expand Down
11 changes: 11 additions & 0 deletions test/authenticator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ const Authenticator = require('../lib/authenticator');


describe('Authenticator', () => {

describe('#sessionManager', () => {
it('should set custom session manager', () => {
const passport = new Authenticator();
const sessionManager = {};
passport.sessionManager(sessionManager);

expect(passport._sm).to.equal(sessionManager);
});
});

describe('#use', () => {
describe('with instance name', () => {
function Strategy() {
Expand Down

0 comments on commit d2d88c7

Please sign in to comment.