@@ -562,7 +562,9 @@ describe('options', function() {
562562 readFileSync = sandbox . stub ( ) ;
563563 readFileSync . onFirstCall ( ) . throws ( ) ;
564564 findConfig = sandbox . stub ( ) . returns ( '/some/.mocharc.json' ) ;
565- loadConfig = sandbox . stub ( ) . returns ( { spec : '*.spec.js' } ) ;
565+ loadConfig = sandbox
566+ . stub ( )
567+ . returns ( { spec : '{dirA,dirB}/**/*.spec.js' } ) ;
566568 findupSync = sandbox . stub ( ) ;
567569 loadOptions = proxyLoadOptions ( {
568570 readFileSync,
@@ -573,10 +575,41 @@ describe('options', function() {
573575 result = loadOptions ( [ '*.test.js' ] ) ;
574576 } ) ;
575577
576- it ( 'should place both into the positional arguments array' , function ( ) {
577- expect ( result , 'to have property' , '_' , [ '*.test.js' , '*.spec.js' ] ) ;
578+ it ( 'should place both - unsplitted - into the positional arguments array' , function ( ) {
579+ expect ( result , 'to have property' , '_' , [
580+ '*.test.js' ,
581+ '{dirA,dirB}/**/*.spec.js'
582+ ] ) ;
578583 } ) ;
579584 } ) ;
580585 } ) ;
586+
587+ describe ( '"ignore" handling' , function ( ) {
588+ let result ;
589+
590+ beforeEach ( function ( ) {
591+ readFileSync = sandbox . stub ( ) ;
592+ readFileSync . onFirstCall ( ) . throws ( ) ;
593+ findConfig = sandbox . stub ( ) . returns ( '/some/.mocharc.json' ) ;
594+ loadConfig = sandbox
595+ . stub ( )
596+ . returns ( { ignore : '{dirA,dirB}/**/*.spec.js' } ) ;
597+ findupSync = sandbox . stub ( ) ;
598+ loadOptions = proxyLoadOptions ( {
599+ readFileSync,
600+ findConfig,
601+ loadConfig,
602+ findupSync
603+ } ) ;
604+ result = loadOptions ( [ '--ignore' , '*.test.js' ] ) ;
605+ } ) ;
606+
607+ it ( 'should not split option values by comma' , function ( ) {
608+ expect ( result , 'to have property' , 'ignore' , [
609+ '*.test.js' ,
610+ '{dirA,dirB}/**/*.spec.js'
611+ ] ) ;
612+ } ) ;
613+ } ) ;
581614 } ) ;
582615} ) ;
0 commit comments