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

18 lines
445 B
JavaScript

'use strict';
const request = require('../helpers/context').request;
const assert = require('assert');
describe('req.type', function(){
it('should return type void of parameters', function(){
const req = request();
req.header['content-type'] = 'text/html; charset=utf-8';
req.type.should.equal('text/html');
});
describe('with no host present', function(){
const req = request();
assert('' === req.type);
});
});