mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[test] started writing tests
This commit is contained in:
parent
004a46c09d
commit
16eacfa961
27
test/lib-caronte-test.js
Normal file
27
test/lib-caronte-test.js
Normal file
@ -0,0 +1,27 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -1,8 +0,0 @@
|
||||
var caronte = require('../'),
|
||||
expect = require('expect.js');
|
||||
|
||||
describe('the truthness', function() {
|
||||
it('should be true', function() {
|
||||
expect(true).to.be(true);
|
||||
})
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user