node-http-proxy/test/lib-caronte-test.js
2013-08-03 16:54:48 +02:00

28 lines
671 B
JavaScript

var caronte = require('../lib/caronte'),
expect = require('expect.js');
describe('lib/caronte.js', function() {
describe('#createProxyServer', function() {
it('should throw without options', function() {
var error;
try {
caronte.createProxyServer();
} catch(e) {
error = e;
}
expect(error).to.be.an(Error);
})
it('should return an object otherwise', function() {
var obj = caronte.createProxyServer({
target: 'http://www.google.com:80'
});
expect(obj.web).to.be.a(Function);
expect(obj.ws).to.be.a(Function);
expect(obj.listen).to.be.a(Function);
});
});
});