refactor ctx.toJSON() to recurse. Closes #108
This commit is contained in:
parent
a2582e7aa3
commit
e78349a73d
2 changed files with 3 additions and 3 deletions
|
@ -35,8 +35,8 @@ module.exports = {
|
|||
|
||||
toJSON: function(){
|
||||
return {
|
||||
request: this.request.toJSON(),
|
||||
response: this.response.toJSON()
|
||||
request: this.request,
|
||||
response: this.response
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ describe('ctx.toJSON()', function(){
|
|||
ctx.status = 200;
|
||||
ctx.body = '<p>Hey</p>';
|
||||
|
||||
var obj = ctx.toJSON();
|
||||
var obj = JSON.parse(JSON.stringify(ctx));
|
||||
var req = obj.request;
|
||||
var res = obj.response;
|
||||
|
||||
|
|
Loading…
Reference in a new issue