[test] started writing tests

This commit is contained in:
yawnt 2013-08-03 16:54:48 +02:00
parent 004a46c09d
commit 16eacfa961
2 changed files with 27 additions and 8 deletions

27
test/lib-caronte-test.js Normal file
View 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);
});
});
});

View File

@ -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);
})
});