koa-lite/test/request/length.js

17 lines
400 B
JavaScript
Raw Permalink Normal View History

2014-07-06 08:43:14 +00:00
var assert = require('assert');
var request = require('../context').request;
describe('ctx.length', function(){
it('should return length in content-length', function(){
var req = request();
req.header['content-length'] = '10';
req.length.should.equal(10);
})
describe('with no content-length present', function(){
var req = request();
assert(null == req.length);
})
})