koa-lite/test/response/header.js
2015-10-13 09:23:57 +02:00

20 lines
498 B
JavaScript

'use strict';
const response = require('../helpers/context').response;
describe('res.header', function(){
it('should return the response header object', function(){
const res = response();
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(){
const res = response();
res.res._headers = null;
res.header.should.eql({});
});
});
});