File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ class Runner extends EventEmitter {
113
113
}
114
114
115
115
if ( metadata . type === 'test' && this . match . length > 0 ) {
116
- metadata . exclusive = title !== null && matcher ( [ title ] , this . match ) . length === 1 ;
116
+ metadata . exclusive = matcher ( [ title || '' ] , this . match ) . length === 1 ;
117
117
}
118
118
119
119
const validationError = validateTest ( title , fn , metadata ) ;
Original file line number Diff line number Diff line change @@ -711,6 +711,32 @@ test('options.match overrides .only', t => {
711
711
} ) ;
712
712
} ) ;
713
713
714
+ test ( 'options.match includes anonymous tests in negative matches' , t => {
715
+ t . plan ( 4 ) ;
716
+
717
+ const runner = new Runner ( {
718
+ match : [ '!*oo' ]
719
+ } ) ;
720
+
721
+ runner . chain . test ( 'foo' , a => {
722
+ t . fail ( ) ;
723
+ a . pass ( ) ;
724
+ } ) ;
725
+
726
+ runner . chain . test ( a => {
727
+ t . pass ( ) ;
728
+ a . pass ( ) ;
729
+ } ) ;
730
+
731
+ runner . run ( { } ) . then ( ( ) => {
732
+ const stats = runner . buildStats ( ) ;
733
+ t . is ( stats . skipCount , 0 ) ;
734
+ t . is ( stats . passCount , 1 ) ;
735
+ t . is ( stats . testCount , 1 ) ;
736
+ t . end ( ) ;
737
+ } ) ;
738
+ } ) ;
739
+
714
740
test ( 'macros: Additional args will be spread as additional args on implementation function' , t => {
715
741
t . plan ( 3 ) ;
716
742
You can’t perform that action at this time.
0 commit comments