specs/index.js
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();
        });
    }
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();
        });
    }
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 ( ) ; } ) ; }
Let the promise resolve as error before making a request
Let the promise resolve as error before making a request