@@ -327,7 +327,6 @@ describe('globals', function() {
327
327
Raven . debug = true ;
328
328
this . sinon . stub ( console , level ) ;
329
329
logDebug ( level , message , { } , 'foo' ) ;
330
- assert . isTrue ( console [ level ] . calledOnce ) ;
331
330
} ) ;
332
331
} ) ;
333
332
@@ -825,15 +824,6 @@ describe('globals', function() {
825
824
} ) ;
826
825
827
826
describe ( 'send' , function ( ) {
828
- it ( 'should check `isSetup`' , function ( ) {
829
- this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
830
- this . sinon . stub ( window , 'makeRequest' ) ;
831
-
832
- send ( ) ;
833
- assert . isTrue ( window . isSetup . calledOnce ) ;
834
- assert . isFalse ( window . makeRequest . calledOnce ) ;
835
- } ) ;
836
-
837
827
it ( 'should build a good data payload' , function ( ) {
838
828
this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
839
829
this . sinon . stub ( window , 'makeRequest' ) ;
@@ -1096,6 +1086,25 @@ describe('globals', function() {
1096
1086
this . sinon . stub ( window , 'newImage' , function ( ) { var img = { } ; imageCache . push ( img ) ; return img ; } ) ;
1097
1087
} )
1098
1088
1089
+ it ( 'should check `isSetup`' , function ( ) {
1090
+ this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
1091
+ makeRequest ( { foo : 'bar' } ) ;
1092
+ assert . isTrue ( window . isSetup . called ) ;
1093
+ } ) ;
1094
+
1095
+ it ( 'should not create the image if `isSetup` is false' , function ( ) {
1096
+ this . sinon . stub ( window , 'isSetup' ) . returns ( false ) ;
1097
+ makeRequest ( { foo : 'bar' } ) ;
1098
+ assert . isFalse ( window . newImage . called ) ;
1099
+ } ) ;
1100
+
1101
+ it ( 'should log to console' , function ( ) {
1102
+ this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
1103
+ this . sinon . stub ( window , 'logDebug' ) ;
1104
+ makeRequest ( { foo : 'bar' } ) ;
1105
+ assert . isTrue ( window . logDebug . called ) ;
1106
+ } ) ;
1107
+
1099
1108
it ( 'should load an Image' , function ( ) {
1100
1109
authQueryString = '?lol' ;
1101
1110
globalServer = 'http://localhost/' ;
@@ -1772,8 +1781,9 @@ describe('Raven (public API)', function() {
1772
1781
it ( 'should not throw an error if not configured' , function ( ) {
1773
1782
this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
1774
1783
this . sinon . stub ( window , 'send' )
1775
- Raven . captureMessage ( 'foo' ) ;
1776
- assert . isFalse ( window . send . called ) ;
1784
+ assert . doesNotThrow ( function ( ) {
1785
+ Raven . captureMessage ( 'foo' ) ;
1786
+ } ) ;
1777
1787
} ) ;
1778
1788
1779
1789
} ) ;
@@ -1830,8 +1840,9 @@ describe('Raven (public API)', function() {
1830
1840
it ( 'should not throw an error if not configured' , function ( ) {
1831
1841
this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
1832
1842
this . sinon . stub ( window , 'handleStackInfo' )
1833
- Raven . captureException ( new Error ( 'err' ) ) ;
1834
- assert . isFalse ( window . handleStackInfo . called ) ;
1843
+ assert . doesNotThrow ( function ( ) {
1844
+ Raven . captureException ( new Error ( 'err' ) ) ;
1845
+ } ) ;
1835
1846
} ) ;
1836
1847
} ) ;
1837
1848
0 commit comments