lib/mockHttpServer.js
// TODO: make these inner functions into methods, for testability
make these inner functions into methods, for testability
make these inner functions into methods for testability
function iterateActions( req, res, actions, next, _i ) {
        if (!_i) _i = 0;
        if (_i >= actions.length) return setImmediate(next);
        actions[_i](req, res, function(err) {
            if (err) return next(err);
            iterateActions(req, res, actions, next, ++_i);
        })
    }
function iterateActions ( req , res , actions , next , _i ) { if ( ! _i ) _i = 0 ; if ( _i >= actions . length ) return setImmediate ( next ) ; actions [ _i ] ( req , res , function ( err ) { if ( err ) return next ( err ) ; iterateActions ( req , res , actions , next , ++ _i ) ; } ) }
TODO: make these inner functions into methods, for testability
TODO : make these inner functions into methods for testability
// TODO: make each call a method call on the shared context! // eg actions[_i].call(this.context, req, res, function(err) { ... })