diff --git a/test/lib-caronte-test.js b/test/lib-caronte-test.js new file mode 100644 index 0000000..8358c5f --- /dev/null +++ b/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); + }); + }); +}); diff --git a/test/truth-test.js b/test/truth-test.js deleted file mode 100644 index 437df34..0000000 --- a/test/truth-test.js +++ /dev/null @@ -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); - }) -});