fix inspection of app. Closes #108
This commit is contained in:
parent
895cf4040c
commit
9b1651a8e6
3 changed files with 10 additions and 0 deletions
|
@ -577,6 +577,7 @@ module.exports = {
|
|||
*/
|
||||
|
||||
inspect: function(){
|
||||
if (!this.req) return;
|
||||
return this.toJSON();
|
||||
},
|
||||
|
||||
|
|
|
@ -432,6 +432,7 @@ module.exports = {
|
|||
*/
|
||||
|
||||
inspect: function(){
|
||||
if (!this.res) return;
|
||||
var o = this.toJSON();
|
||||
o.body = this.body;
|
||||
return o;
|
||||
|
|
|
@ -61,6 +61,14 @@ describe('app.toJSON()', function(){
|
|||
})
|
||||
})
|
||||
|
||||
describe('app.inspect()', function(){
|
||||
it('should work', function(){
|
||||
var app = koa();
|
||||
var util = require('util');
|
||||
var str = util.inspect(app);
|
||||
})
|
||||
})
|
||||
|
||||
describe('app.use(fn)', function(){
|
||||
it('should compose middleware', function(done){
|
||||
var app = koa();
|
||||
|
|
Loading…
Reference in a new issue