more test case
This commit is contained in:
parent
8774979e13
commit
065a773e65
3 changed files with 34 additions and 2 deletions
|
@ -7,4 +7,12 @@ describe('res.header', function(){
|
|||
res.set('X-Foo', 'bar');
|
||||
res.header.should.eql({ 'x-foo': 'bar' });
|
||||
})
|
||||
})
|
||||
|
||||
describe('when res._headers not present', function (){
|
||||
it('should return empty object', function (){
|
||||
var res = response();
|
||||
res.res._headers = null;
|
||||
res.header.should.eql({});
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -24,4 +24,11 @@ describe('res.lastModified', function(){
|
|||
(res.lastModified.getTime() / 1000)
|
||||
.should.equal(Math.floor(date.getTime() / 1000));
|
||||
})
|
||||
})
|
||||
|
||||
describe('when lastModified not set', function (){
|
||||
it('should get undefined', function(){
|
||||
var res = response();
|
||||
(res.lastModified === undefined).should.be.ok;
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
17
test/response/writeable.js
Normal file
17
test/response/writeable.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
|
||||
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;
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Reference in a new issue