@@ -1578,6 +1578,28 @@ describe('Raven (public API)', function() {
1578
1578
assert . isFalse ( TraceKit . collectWindowErrors ) ;
1579
1579
} ) ;
1580
1580
} ) ;
1581
+
1582
+ describe ( 'maxBreadcrumbs' , function ( ) {
1583
+ it ( 'should override the default' , function ( ) {
1584
+ Raven . config ( SENTRY_DSN , { maxBreadcrumbs : 50 } ) ;
1585
+ assert . equal ( Raven . _globalOptions . maxBreadcrumbs , 50 ) ;
1586
+ } ) ;
1587
+
1588
+ it ( 'should not permit maxBreadcrumbs above 100' , function ( ) {
1589
+ Raven . config ( SENTRY_DSN , { maxBreadcrumbs : 200 } ) ;
1590
+ assert . equal ( Raven . _globalOptions . maxBreadcrumbs , 100 ) ;
1591
+ } ) ;
1592
+
1593
+ it ( 'should not permit maxBreadcrumbs below 0' , function ( ) {
1594
+ Raven . config ( SENTRY_DSN , { maxBreadcrumbs : - 1 } ) ;
1595
+ assert . equal ( Raven . _globalOptions . maxBreadcrumbs , 0 ) ;
1596
+ } ) ;
1597
+
1598
+ it ( 'should set maxBreadcrumbs to the default if not provided' , function ( ) {
1599
+ Raven . config ( SENTRY_DSN ) ;
1600
+ assert . equal ( Raven . _globalOptions . maxBreadcrumbs , 100 ) ;
1601
+ } ) ;
1602
+ } ) ;
1581
1603
} ) ;
1582
1604
1583
1605
describe ( '.wrap' , function ( ) {
@@ -2063,7 +2085,7 @@ describe('Raven (public API)', function() {
2063
2085
} ) ;
2064
2086
2065
2087
it ( 'should dequeue the oldest breadcrumb when over limit' , function ( ) {
2066
- Raven . _breadcrumbLimit = 5 ;
2088
+ Raven . _globalOptions . maxBreadcrumbs = 5 ;
2067
2089
Raven . _breadcrumbs = [
2068
2090
{ message : '1' , timestamp : 0.1 } ,
2069
2091
{ message : '2' , timestamp : 0.1 } ,
0 commit comments