@@ -1512,6 +1512,7 @@ describe('Raven (public API)', function() {
1512
1512
1513
1513
it ( 'should re-raise a thrown exception' , function ( ) {
1514
1514
var error = new Error ( 'lol' ) ;
1515
+ this . sinon . stub ( Raven , 'captureException' ) ;
1515
1516
assert . throws ( function ( ) {
1516
1517
Raven . wrap ( function ( ) { throw error ; } ) ( ) ;
1517
1518
} , error ) ;
@@ -1728,46 +1729,45 @@ describe('Raven (public API)', function() {
1728
1729
} ) ;
1729
1730
1730
1731
describe ( '.captureException' , function ( ) {
1731
- it ( 'should call TraceKit.report ' , function ( ) {
1732
+ it ( 'should call handleStackInfo ' , function ( ) {
1732
1733
var error = new Error ( 'crap' ) ;
1733
- this . sinon . stub ( TraceKit , 'report ' ) ;
1734
+ this . sinon . stub ( window , 'handleStackInfo ' ) ;
1734
1735
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 ) ;
1737
1737
} ) ;
1738
1738
1739
1739
it ( 'should store the last exception' , function ( ) {
1740
1740
var error = new Error ( 'crap' ) ;
1741
- this . sinon . stub ( TraceKit , 'report ' ) ;
1741
+ this . sinon . stub ( window , 'handleStackInfo ' ) ;
1742
1742
Raven . captureException ( error ) ;
1743
1743
assert . equal ( Raven . lastException ( ) , error ) ;
1744
1744
} ) ;
1745
1745
1746
1746
it ( 'shouldn\'t reraise the if the error is the same error' , function ( ) {
1747
1747
var error = new Error ( 'crap' ) ;
1748
- this . sinon . stub ( TraceKit , 'report ' ) . throws ( error ) ;
1748
+ this . sinon . stub ( window , 'handleStackInfo ' ) . throws ( error ) ;
1749
1749
// this would raise if the errors didn't match
1750
1750
Raven . captureException ( error , { foo : 'bar' } ) ;
1751
- assert . isTrue ( TraceKit . report . calledOnce ) ;
1751
+ assert . isTrue ( window . handleStackInfo . calledOnce ) ;
1752
1752
} ) ;
1753
1753
1754
1754
it ( 'should reraise a different error' , function ( ) {
1755
1755
var error = new Error ( 'crap1' ) ;
1756
- this . sinon . stub ( TraceKit , 'report ' ) . throws ( error ) ;
1756
+ this . sinon . stub ( window , 'handleStackInfo ' ) . throws ( error ) ;
1757
1757
assert . throws ( function ( ) {
1758
1758
Raven . captureException ( new Error ( 'crap2' ) ) ;
1759
1759
} , error ) ;
1760
1760
} ) ;
1761
1761
1762
1762
it ( 'should capture as a normal message if a non-Error is passed' , function ( ) {
1763
1763
this . sinon . stub ( Raven , 'captureMessage' ) ;
1764
- this . sinon . stub ( TraceKit , 'report' ) ;
1764
+ this . sinon . stub ( window , 'handleStackInfo' )
1765
1765
Raven . captureException ( 'derp' ) ;
1766
1766
assert . equal ( Raven . captureMessage . lastCall . args [ 0 ] , 'derp' ) ;
1767
- assert . isFalse ( TraceKit . report . called ) ;
1767
+ assert . isFalse ( window . handleStackInfo . called ) ;
1768
1768
Raven . captureException ( true ) ;
1769
1769
assert . equal ( Raven . captureMessage . lastCall . args [ 0 ] , true ) ;
1770
- assert . isFalse ( TraceKit . report . called ) ;
1770
+ assert . isFalse ( window . handleStackInfo . called ) ;
1771
1771
} ) ;
1772
1772
} ) ;
1773
1773
0 commit comments