mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
|
|
describe('server', function () {
|
|
|
|
it('should disallow non-existent transports', function (done) {
|
|
var engine = eio.listen(4000, function () {
|
|
request.get('http://localhost:4000/engine.io')
|
|
.data({ transport: 'tobi' }) // no tobi transport - outrageous
|
|
.end(function (err, res) {
|
|
expect(res.status).to.be(500);
|
|
engine.httpServer.once('close', done);
|
|
engine.httpServer.close();
|
|
});
|
|
});
|
|
});
|
|
|
|
it('should disallow `constructor` as transports', function (done) {
|
|
// make sure we check for actual properties - not those present on every {}
|
|
var engine = eio.listen(4000, function () {
|
|
request.get('http://localhost:4000/engine.io')
|
|
.data({ transport: 'constructor' })
|
|
.end(function (err, res) {
|
|
expect(res.status).to.be(500);
|
|
engine.httpServer.once('close', done);
|
|
engine.httpServer.close();
|
|
});
|
|
});
|
|
});
|
|
|
|
it('should disallow non-existent sids', function (done) {
|
|
var engine = eio.listen(4000, function () {
|
|
request.get('http://localhost:4000/engine.io')
|
|
.data({ sid: 'test' })
|
|
.end(function (err, res) {
|
|
expect(res.status).to.be(500);
|
|
engine.httpServer.once('close', done);
|
|
engine.httpServer.close();
|
|
});
|
|
});
|
|
});
|
|
|
|
});
|