koa-lite/test/response/writeable.js
2014-10-01 20:42:29 +08:00

17 lines
436 B
JavaScript

var response = require('../context').response;
describe('res.writable', function(){
it('should return the request is writable', function(){
var res = response();
res.writable.should.be.ok;
})
describe('when res.socket not present', function (){
it('should return the request is not writable', function (){
var res = response();
res.res.socket = null;
res.writable.should.not.be.ok;
})
})
})