Records your middleware and gives you a result you can assert
This module will pass fakes to your middleware which you can assert.
var recorder = require'express-recorder';// Middlewarevarreslocalsusername = reqbodyfirstname + ' ' + reslocalslastname;next;;// Setup statevar body = firstname: 'Geert' ;var locals = lastname: 'Pasteels' ;recordermiddleware body: body locals: localsresulteqlnext: truelocals: lastname: 'Pasteels' username: 'Geert Pasteels';;
The 'request' option is used to add properties to the request object.
recordermiddleware request: missing: 'MIA'//assert;
The result object has the following properties for asserting.
It also has a handy eql method that shows the difference between the result object and your expected object.