File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,10 @@ var Raven = {
5252 * @return {Raven }
5353 */
5454 config : function ( dsn , options ) {
55+ if ( globalServer ) {
56+ logDebug ( 'error' , 'Error: Raven has already been configured' ) ;
57+ return Raven ;
58+ }
5559 if ( ! dsn ) return Raven ;
5660
5761 var uri = parseDSN ( dsn ) ,
Original file line number Diff line number Diff line change @@ -1169,6 +1169,15 @@ describe('Raven (public API)', function() {
11691169 assert . equal ( Raven . config ( '' ) , Raven ) ;
11701170 } ) ;
11711171
1172+ it ( 'should not set global options more than once' , function ( ) {
1173+ this . sinon . spy ( window , 'parseDSN' ) ;
1174+ this . sinon . stub ( window , 'logDebug' ) ;
1175+ setupRaven ( ) ;
1176+ setupRaven ( ) ;
1177+ assert . isTrue ( parseDSN . calledOnce ) ;
1178+ assert . isTrue ( logDebug . called ) ;
1179+ } ) ;
1180+
11721181 describe ( 'whitelistUrls' , function ( ) {
11731182 it ( 'should be false if none are passed' , function ( ) {
11741183 Raven . config ( '//abc@example.com/2' ) ;
You can’t perform that action at this time.
0 commit comments