mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
28 lines
671 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|