@@ -1578,6 +1578,28 @@ describe('Raven (public API)', function() {
15781578 assert . isFalse ( TraceKit . collectWindowErrors ) ;
15791579 } ) ;
15801580 } ) ;
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+ } ) ;
15811603 } ) ;
15821604
15831605 describe ( '.wrap' , function ( ) {
@@ -2063,7 +2085,7 @@ describe('Raven (public API)', function() {
20632085 } ) ;
20642086
20652087 it ( 'should dequeue the oldest breadcrumb when over limit' , function ( ) {
2066- Raven . _breadcrumbLimit = 5 ;
2088+ Raven . _globalOptions . maxBreadcrumbs = 5 ;
20672089 Raven . _breadcrumbs = [
20682090 { message : '1' , timestamp : 0.1 } ,
20692091 { message : '2' , timestamp : 0.1 } ,
0 commit comments