code: function makeRequest(capturedError) {
        req(app)
          .get('/bundle.js')
          .expect(500)
          .end(function(err, res) {
            if (err) {
              done(err);
            }
            assert.ok(capturedError, 'expected error in onerror');
            assert.equal(res.text, capturedError.stack);
            done();
          });
      }
docs: Let the promise resolve as error before making a request