@@ -477,16 +477,38 @@ describe('globals', function() {
477477 describe ( 'processException' , function ( ) {
478478 it ( 'should respect `ignoreErrors`' , function ( ) {
479479 this . sinon . stub ( Raven , '_send' ) ;
480+ Raven . _globalOptions . ignoreErrors = joinRegExp ( [
481+ 'msg1' ,
482+ 'CustomError1' ,
483+ 'CustomError2: msg2' ,
484+ / ^ m s g 3 / ,
485+ / ^ R e g e x E r r o r 1 / ,
486+ / ^ R e g e x E r r o r 2 : m s g 4 /
487+ ] ) ;
488+ Raven . _processException ( 'Error' , 'msg1' , 'http://example.com' , [ ] ) ;
489+ assert . isFalse ( Raven . _send . called ) ;
490+ Raven . _processException ( undefined , 'msg1' , 'http://example.com' , [ ] ) ;
491+ assert . isFalse ( Raven . _send . called ) ;
492+ Raven . _processException ( 'CustomError1' , 'error' , 'http://example.com' , [ ] ) ;
493+ assert . isFalse ( Raven . _send . called ) ;
494+ Raven . _processException ( 'CustomError2' , 'msg2' , 'http://example.com' , [ ] ) ;
495+ assert . isFalse ( Raven . _send . called ) ;
480496
481- Raven . _globalOptions . ignoreErrors = joinRegExp ( [ 'e1' , 'e2' , 'CustomError' ] ) ;
482- Raven . _processException ( 'Error' , 'e1' , 'http://example.com' , [ ] ) ;
497+ Raven . _processException ( 'Error' , 'msg3' , 'http://example.com' , [ ] ) ;
483498 assert . isFalse ( Raven . _send . called ) ;
484- Raven . _processException ( 'Error' , 'e2 ' , 'http://example.com' , [ ] ) ;
499+ Raven . _processException ( undefined , 'msg3 ' , 'http://example.com' , [ ] ) ;
485500 assert . isFalse ( Raven . _send . called ) ;
486- Raven . _processException ( 'CustomError ' , 'e3 ' , 'http://example.com' , [ ] ) ;
501+ Raven . _processException ( 'RegexError1 ' , 'error ' , 'http://example.com' , [ ] ) ;
487502 assert . isFalse ( Raven . _send . called ) ;
503+ Raven . _processException ( 'RegexError2' , 'msg4' , 'http://example.com' , [ ] ) ;
504+ assert . isFalse ( Raven . _send . called ) ;
505+
488506 Raven . _processException ( 'Error' , 'error' , 'http://example.com' , [ ] ) ;
489507 assert . isTrue ( Raven . _send . calledOnce ) ;
508+ Raven . _processException ( 'CustomError2' , 'error' , 'http://example.com' , [ ] ) ;
509+ assert . isTrue ( Raven . _send . calledTwice ) ;
510+ Raven . _processException ( 'RegexError2' , 'error' , 'http://example.com' , [ ] ) ;
511+ assert . isTrue ( Raven . _send . calledThrice ) ;
490512 } ) ;
491513
492514 it ( 'should handle empty `ignoreErrors`' , function ( ) {
0 commit comments