koa-lite/test/response/writeable.js

20 lines
467 B
JavaScript
Raw Normal View History

2014-10-01 12:42:29 +00:00
'use strict';
const response = require('../helpers/context').response;
2014-10-01 12:42:29 +00:00
describe('res.writable', function(){
it('should return the request is writable', function(){
const res = response();
2014-10-01 12:42:29 +00:00
res.writable.should.be.ok;
2015-10-12 20:36:41 +00:00
});
2014-10-01 12:42:29 +00:00
2015-10-12 20:36:41 +00:00
describe('when res.socket not present', function(){
it('should return the request is not writable', function(){
const res = response();
2014-10-01 12:42:29 +00:00
res.res.socket = null;
res.writable.should.not.be.ok;
2015-10-12 20:36:41 +00:00
});
});
});