Skip to content

Commit 16eacfa

Browse files
committed
[test] started writing tests
1 parent 004a46c commit 16eacfa

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

test/lib-caronte-test.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
var caronte = require('../lib/caronte'),
2+
expect = require('expect.js');
3+
4+
describe('lib/caronte.js', function() {
5+
describe('#createProxyServer', function() {
6+
it('should throw without options', function() {
7+
var error;
8+
try {
9+
caronte.createProxyServer();
10+
} catch(e) {
11+
error = e;
12+
}
13+
14+
expect(error).to.be.an(Error);
15+
})
16+
17+
it('should return an object otherwise', function() {
18+
var obj = caronte.createProxyServer({
19+
target: 'http://www.google.com:80'
20+
});
21+
22+
expect(obj.web).to.be.a(Function);
23+
expect(obj.ws).to.be.a(Function);
24+
expect(obj.listen).to.be.a(Function);
25+
});
26+
});
27+
});

test/truth-test.js

-8
This file was deleted.

0 commit comments

Comments
 (0)