Skip to content

Commit

Permalink
use express response instead a fake one
Browse files Browse the repository at this point in the history
  • Loading branch information
harttle committed Feb 18, 2017
1 parent 7abaed6 commit fa504cb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "brick.js",
"version": "3.0.2",
"version": "3.0.3",
"description": "A HMVC style web-dev framework for Node.js",
"main": "index.js",
"scripts": {
Expand Down
13 changes: 1 addition & 12 deletions src/response.js
@@ -1,18 +1,7 @@
const _ = require('lodash');
const methods = ['append', 'attachment', 'cookie', 'clearCookie', 'download', 'end', 'format', 'get', 'json', 'jsonp', 'links', 'location', 'redirect', 'render', 'send', 'sendFile', 'sendStatus', 'set', 'status', 'type', 'vary'];

exports.create = function(res, extend) {
var response = {};

methods.forEach(function(name) {
var method;
if (method = res[name]) {
response[name] = function() {
method.apply(res, arguments);
return response;
};
}
});

return _.assign(response, extend);
return _.assign(res, extend);
};
3 changes: 0 additions & 3 deletions test/response.js
Expand Up @@ -16,7 +16,4 @@ describe('response', function() {
response.status(404);
expect(res.status).to.have.been.called;
});
it('status should return response', function(){
expect(response.status(404)).to.equal(response);
});
});

0 comments on commit fa504cb

Please sign in to comment.