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 = {
52
52
* @return {Raven }
53
53
*/
54
54
config : function ( dsn , options ) {
55
+ if ( globalServer ) {
56
+ logDebug ( 'error' , 'Error: Raven has already been configured' ) ;
57
+ return Raven ;
58
+ }
55
59
if ( ! dsn ) return Raven ;
56
60
57
61
var uri = parseDSN ( dsn ) ,
Original file line number Diff line number Diff line change @@ -1169,6 +1169,15 @@ describe('Raven (public API)', function() {
1169
1169
assert . equal ( Raven . config ( '' ) , Raven ) ;
1170
1170
} ) ;
1171
1171
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
+
1172
1181
describe ( 'whitelistUrls' , function ( ) {
1173
1182
it ( 'should be false if none are passed' , function ( ) {
1174
1183
Raven . config ( '//abc@example.com/2' ) ;
You can’t perform that action at this time.
0 commit comments