Example #1
0
 var engine = listen({ cookie: false }, function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'polling' })
     .end(function (res) {
       expect(res.headers['set-cookie']).to.be(undefined);
       done();
     });
 });
Example #2
0
 var engine = listen(function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'polling', sid: 'test' })
     .end(function (res) {
       expect(res.status).to.be(500);
       done();
     });
 });
Example #3
0
 var engine = listen(function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'tobi' }) // no tobi transport - outrageous
     .end(function (res) {
       expect(res.status).to.be(500);
       done();
     });
 });
Example #4
0
 var engine = listen({ cookie: 'woot' }, function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'polling' })
     .end(function (res) {
       var sid = res.text.match(/"sid":"([^"]+)"/)[1];
       expect(res.headers['set-cookie'][0]).to.be('woot=' + sid);
       done();
     });
 });
Example #5
0
 var engine = listen(function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'polling', sid: 'test' })
     .end(function (res) {
       expect(res.status).to.be(400);
       expect(res.body.code).to.be(1);
       expect(res.body.message).to.be('Session ID unknown');
       done();
     });
 });
Example #6
0
 var engine = listen(function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'constructor' })
     .end(function (res) {
       expect(res.status).to.be(400);
       expect(res.body.code).to.be(0);
       expect(res.body.message).to.be('Transport unknown');
       done();
     });
 });
Example #7
0
 var engine = listen(function (port) {
   request.get('http://localhost:%d/engine.io/default/'.s(port))
     .query({ transport: 'websocket' })
     .end(function (res) {
       expect(res.status).to.be(400);
       expect(res.body.code).to.be(3);
       expect(res.body.message).to.be('Bad request');
       done();
     });
 });
 script.__defineSetter__('src', function (uri) {
   request.get(uri).end(function(res) {
     eval(res.text);
   });
 });