Skip to content

Commit

Permalink
[test] started writing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Aug 3, 2013
1 parent 004a46c commit 16eacfa
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
27 changes: 27 additions & 0 deletions test/lib-caronte-test.js
@@ -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);
});
});
});
8 changes: 0 additions & 8 deletions test/truth-test.js

This file was deleted.

0 comments on commit 16eacfa

Please sign in to comment.