Created
April 9, 2015 15:51
-
-
Save lennym/ada2f58f7b4190652325 to your computer and use it in GitHub Desktop.
Example middleware test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var middleware = require('./my-middleware') | |
describe('middleware', function () { | |
var req, res; | |
beforeEach(function () { | |
req = { | |
session: { username: 'lennym' } | |
}, | |
res = {} | |
}); | |
it('adds a username property to the request', function (done) { | |
middleware(req, res, function (err) { | |
req.username.should.equal('lennym'); | |
done(err); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment