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(){
|
inspect: function(){
|
||||||
|
if (!this.req) return;
|
||||||
return this.toJSON();
|
return this.toJSON();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -432,6 +432,7 @@ module.exports = {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
inspect: function(){
|
inspect: function(){
|
||||||
|
if (!this.res) return;
|
||||||
var o = this.toJSON();
|
var o = this.toJSON();
|
||||||
o.body = this.body;
|
o.body = this.body;
|
||||||
return o;
|
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(){
|
describe('app.use(fn)', function(){
|
||||||
it('should compose middleware', function(done){
|
it('should compose middleware', function(done){
|
||||||
var app = koa();
|
var app = koa();
|
||||||
|
|
Loading…
Reference in a new issue