node-http-proxy/test/lib-caronte-passes-web-test.js
2013-08-21 17:37:38 +02:00

29 lines
778 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var caronte = require('../lib/caronte/passes/web'),
expect = require('expect.js');
describe('lib/caronte/passes/web.js', function() {
describe('#deleteLength', function() {
it('should change `content-length`', function() {
var stubRequest = {
method: 'DELETE',
headers: {}
};
caronte.deleteLength(stubRequest, {}, {});
expect(stubRequest.headers['content-length']).to.eql('0');
})
});
describe('#timeout', function() {
it('should set timeout on the socket', function() {
var done = false, stubRequest = {
socket: {
setTimeout: function(value) { done = value; }
}
}
caronte.timeout(stubRequest, {}, { timeout: 5000});
expect(done).to.eql(5000);
});
});
});