Test suite skeleton. Closes #6

This commit is contained in:
Michelle Bu 2013-07-06 22:43:49 -07:00
parent 6140fb391d
commit c9e6476094
2 changed files with 73 additions and 0 deletions

View File

@ -14,5 +14,10 @@
"restify": "~2.3.5",
"ws": "~0.4.25",
"optimist": "*"
},
"devDependencies": {
"expect.js": "*",
"sinon": "*",
"mocha": "*"
}
}

68
test/server.js Normal file
View File

@ -0,0 +1,68 @@
var PeerServer = require('../').PeerServer;
var expect = require('expect.js');
var sinon = require('sinon');
describe('PeerServer', function() {
describe('constructor', function() {
before(function() {
PeerServer.prototype._initializeWSS = sinon.stub();
PeerServer.prototype._initializeHTTP = sinon.stub();
});
it('should be able to be created without the `new` keyword', function() {
var p = PeerServer();
expect(p.constructor).to.be(PeerServer);
});
it('should default to port 80, key `peerjs`', function() {
var p = new PeerServer();
expect(p._options.key).to.be('peerjs');
expect(p._options.port).to.be(80);
});
it('should accept a custom port', function() {
var p = new PeerServer({ port: 8000 });
expect(p._options.port).to.be(8000);
});
});
describe('#_initializeWSS', function() {
});
describe('#_configureWS', function() {
});
describe('#_checkKey', function() {
});
describe('#_initializeHTTP', function() {
});
describe('#_startStreaming', function() {
});
describe('#_pruneOutstanding', function() {
});
describe('#_processOutstanding', function() {
});
describe('#_removePeer', function() {
});
describe('#_handleTransmission', function() {
});
describe('#_generateClientId', function() {
});
});