@@ -327,7 +327,6 @@ describe('globals', function() {
327327 Raven . debug = true ;
328328 this . sinon . stub ( console , level ) ;
329329 logDebug ( level , message , { } , 'foo' ) ;
330- assert . isTrue ( console [ level ] . calledOnce ) ;
331330 } ) ;
332331 } ) ;
333332
@@ -825,15 +824,6 @@ describe('globals', function() {
825824 } ) ;
826825
827826 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-
837827 it ( 'should build a good data payload' , function ( ) {
838828 this . sinon . stub ( window , 'isSetup' ) . returns ( true ) ;
839829 this . sinon . stub ( window , 'makeRequest' ) ;
@@ -1096,6 +1086,25 @@ describe('globals', function() {
10961086 this . sinon . stub ( window , 'newImage' , function ( ) { var img = { } ; imageCache . push ( img ) ; return img ; } ) ;
10971087 } )
10981088
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+
10991108 it ( 'should load an Image' , function ( ) {
11001109 authQueryString = '?lol' ;
11011110 globalServer = 'http://localhost/' ;
@@ -1772,8 +1781,9 @@ describe('Raven (public API)', function() {
17721781 it ( 'should not throw an error if not configured' , function ( ) {
17731782 this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
17741783 this . sinon . stub ( window , 'send' )
1775- Raven . captureMessage ( 'foo' ) ;
1776- assert . isFalse ( window . send . called ) ;
1784+ assert . doesNotThrow ( function ( ) {
1785+ Raven . captureMessage ( 'foo' ) ;
1786+ } ) ;
17771787 } ) ;
17781788
17791789 } ) ;
@@ -1830,8 +1840,9 @@ describe('Raven (public API)', function() {
18301840 it ( 'should not throw an error if not configured' , function ( ) {
18311841 this . sinon . stub ( Raven , 'isSetup' ) . returns ( false ) ;
18321842 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+ } ) ;
18351846 } ) ;
18361847 } ) ;
18371848
0 commit comments