@@ -1512,6 +1512,7 @@ describe('Raven (public API)', function() {
15121512
15131513 it ( 'should re-raise a thrown exception' , function ( ) {
15141514 var error = new Error ( 'lol' ) ;
1515+ this . sinon . stub ( Raven , 'captureException' ) ;
15151516 assert . throws ( function ( ) {
15161517 Raven . wrap ( function ( ) { throw error ; } ) ( ) ;
15171518 } , error ) ;
@@ -1728,46 +1729,45 @@ describe('Raven (public API)', function() {
17281729 } ) ;
17291730
17301731 describe ( '.captureException' , function ( ) {
1731- it ( 'should call TraceKit.report ' , function ( ) {
1732+ it ( 'should call handleStackInfo ' , function ( ) {
17321733 var error = new Error ( 'crap' ) ;
1733- this . sinon . stub ( TraceKit , 'report ' ) ;
1734+ this . sinon . stub ( window , 'handleStackInfo ' ) ;
17341735 Raven . captureException ( error , { foo : 'bar' } ) ;
1735- assert . isTrue ( TraceKit . report . calledOnce ) ;
1736- assert . deepEqual ( TraceKit . report . lastCall . args , [ error , { foo : 'bar' } ] ) ;
1736+ assert . isTrue ( window . handleStackInfo . calledOnce ) ;
17371737 } ) ;
17381738
17391739 it ( 'should store the last exception' , function ( ) {
17401740 var error = new Error ( 'crap' ) ;
1741- this . sinon . stub ( TraceKit , 'report ' ) ;
1741+ this . sinon . stub ( window , 'handleStackInfo ' ) ;
17421742 Raven . captureException ( error ) ;
17431743 assert . equal ( Raven . lastException ( ) , error ) ;
17441744 } ) ;
17451745
17461746 it ( 'shouldn\'t reraise the if the error is the same error' , function ( ) {
17471747 var error = new Error ( 'crap' ) ;
1748- this . sinon . stub ( TraceKit , 'report ' ) . throws ( error ) ;
1748+ this . sinon . stub ( window , 'handleStackInfo ' ) . throws ( error ) ;
17491749 // this would raise if the errors didn't match
17501750 Raven . captureException ( error , { foo : 'bar' } ) ;
1751- assert . isTrue ( TraceKit . report . calledOnce ) ;
1751+ assert . isTrue ( window . handleStackInfo . calledOnce ) ;
17521752 } ) ;
17531753
17541754 it ( 'should reraise a different error' , function ( ) {
17551755 var error = new Error ( 'crap1' ) ;
1756- this . sinon . stub ( TraceKit , 'report ' ) . throws ( error ) ;
1756+ this . sinon . stub ( window , 'handleStackInfo ' ) . throws ( error ) ;
17571757 assert . throws ( function ( ) {
17581758 Raven . captureException ( new Error ( 'crap2' ) ) ;
17591759 } , error ) ;
17601760 } ) ;
17611761
17621762 it ( 'should capture as a normal message if a non-Error is passed' , function ( ) {
17631763 this . sinon . stub ( Raven , 'captureMessage' ) ;
1764- this . sinon . stub ( TraceKit , 'report' ) ;
1764+ this . sinon . stub ( window , 'handleStackInfo' )
17651765 Raven . captureException ( 'derp' ) ;
17661766 assert . equal ( Raven . captureMessage . lastCall . args [ 0 ] , 'derp' ) ;
1767- assert . isFalse ( TraceKit . report . called ) ;
1767+ assert . isFalse ( window . handleStackInfo . called ) ;
17681768 Raven . captureException ( true ) ;
17691769 assert . equal ( Raven . captureMessage . lastCall . args [ 0 ] , true ) ;
1770- assert . isFalse ( TraceKit . report . called ) ;
1770+ assert . isFalse ( window . handleStackInfo . called ) ;
17711771 } ) ;
17721772 } ) ;
17731773
0 commit comments