title: learning testing in mocha with supertest. can't get test to fail
body: <p>I am not sure how, but I can not for the life of me figure out how to make this test fail. I honestly don't really know what I'm doing, but seeing as <code>/fail</code> doesn't exist AND all my routes are protected with authentication, which results in a <code>GET /fail 401</code> the test should fail seeing as it <code>expect(200)</code>. So what is going on here?</p>
  
  <pre><code>var app = require('../../app');
  var request = require('supertest');
  var agent = request.agent(app);
  
  describe('Index Routes', function(done){
    it('should return 200 status code', function(done){
        agent.get('/').expect(500, done);
    });
  
    it('should fail horribly', function(done){
      agent.get('/fail').expect(200, done);
    })
  });
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>&gt; istanbul cover node_modules/mocha/bin/_mocha -x database.js
  
    Index Routes
  [0mGET / [32m200 [0m374.389 ms - 170[0m
  
      1) should return 200 status code
  [0mGET /fail [33m401 [0m1.723 ms - 21[0m
  
      √ should fail horribly
  
  
    1 passing (415ms)
    1 failing
  
    1) Index Routes should return 200 status code:
       Error: expected 500 "Internal Server Error", got 200 "OK"
        at Test._assertStatus (C:\Users\janedoe\WalkingApp-WebService\node_modules\supertest\lib\test.js:232:12)
        at Test._assertFunction (C:\Users\janedoe\WalkingApp-WebService\node_modules\supertest\lib\test.js:247:11)
        at Test.assert (C:\Users\janedoe\WalkingApp-WebService\node_modules\supertest\lib\test.js:148:18)
        at Server.assert (C:\Users\janedoe\WalkingApp-WebService\node_modules\supertest\lib\test.js:127:12)
        at emitCloseNT (net.js:1521:8)
  
  
  =============================== Coverage summary ===============================
  Statements   : 58.05% ( 101/174 )
  Branches     : 6.25% ( 2/32 )
  Functions    : 12.9% ( 4/31 )
  Lines        : 61.59% ( 101/164 )
  ================================================================================
  </code></pre>