How to use supertest

Comprehensive supertest code examples:

How to use supertest.get:

240
241
242
243
244
245
246
247
248
249
describe('handshake', function(){
  var request = require('superagent');

  it('should disallow request when origin defined and none specified', function(done) {
    var sockets = io({ origins: 'http://foo.example:*' }).listen('54013');
    request.get('http://localhost:54013/socket.io/default/')
     .query({ transport: 'polling' })
     .end(function (err, res) {
        expect(res.status).to.be(403);
        done();