@@ -20,7 +20,9 @@ _Raven.prototype._getUuid = function() {
2020 return 'abc123' ;
2121} ;
2222
23- var joinRegExp = require ( '../src/utils' ) . joinRegExp ;
23+ var utils = require ( '../src/utils' ) ;
24+ var joinRegExp = utils . joinRegExp ;
25+ var supportsErrorEvent = utils . supportsErrorEvent ;
2426
2527// window.console must be stubbed in for browsers that don't have it
2628if ( typeof window . console === 'undefined' ) {
@@ -2770,21 +2772,23 @@ describe('Raven (public API)', function() {
27702772 } ) ;
27712773
27722774 describe ( '.captureException' , function ( ) {
2773- it ( 'should treat ErrorEvents similarly to Errors' , function ( ) {
2774- var error = new ErrorEvent ( 'pickleRick' , { error : new Error ( 'pickleRick' ) } ) ;
2775- this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
2776- this . sinon . stub ( Raven , '_handleStackInfo' ) ;
2777- Raven . captureException ( error , { foo : 'bar' } ) ;
2778- assert . isTrue ( Raven . _handleStackInfo . calledOnce ) ;
2779- } ) ;
2775+ if ( supportsErrorEvent ( ) ) {
2776+ it ( 'should treat ErrorEvents similarly to Errors' , function ( ) {
2777+ var error = new ErrorEvent ( 'pickleRick' , { error : new Error ( 'pickleRick' ) } ) ;
2778+ this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
2779+ this . sinon . stub ( Raven , '_handleStackInfo' ) ;
2780+ Raven . captureException ( error , { foo : 'bar' } ) ;
2781+ assert . isTrue ( Raven . _handleStackInfo . calledOnce ) ;
2782+ } ) ;
27802783
2781- it ( 'should send ErrorEvents without Errors as messages' , function ( ) {
2782- var error = new ErrorEvent ( 'pickleRick' ) ;
2783- this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
2784- this . sinon . stub ( Raven , 'captureMessage' ) ;
2785- Raven . captureException ( error , { foo : 'bar' } ) ;
2786- assert . isTrue ( Raven . captureMessage . calledOnce ) ;
2787- } ) ;
2784+ it ( 'should send ErrorEvents without Errors as messages' , function ( ) {
2785+ var error = new ErrorEvent ( 'pickleRick' ) ;
2786+ this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
2787+ this . sinon . stub ( Raven , 'captureMessage' ) ;
2788+ Raven . captureException ( error , { foo : 'bar' } ) ;
2789+ assert . isTrue ( Raven . captureMessage . calledOnce ) ;
2790+ } ) ;
2791+ }
27882792
27892793 it ( 'should send non-Errors as messages' , function ( ) {
27902794 this . sinon . stub ( Raven , 'isSetup' ) . returns ( true ) ;
0 commit comments