File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ function TestExclude (opts) {
14
14
configFound : false
15
15
} , opts )
16
16
17
+ if ( typeof this . include === 'string' ) this . include = [ this . include ]
18
+ if ( typeof this . exclude === 'string' ) this . exclude = [ this . exclude ]
19
+
17
20
if ( ! this . include && ! this . exclude && this . configKey ) {
18
21
assign ( this , this . pkgConf ( this . configKey , this . configPath ) )
19
22
}
Original file line number Diff line number Diff line change @@ -183,4 +183,14 @@ describe('testExclude', function () {
183
183
} )
184
184
} )
185
185
} )
186
+
187
+ // see: https://github.com/istanbuljs/babel-plugin-istanbul/issues/71
188
+ it ( 'allows exclude/include rule to be a string' , function ( ) {
189
+ const e = exclude ( {
190
+ exclude : 'src/**/*.spec.js' ,
191
+ include : 'src/**'
192
+ } )
193
+ e . shouldInstrument ( 'src/batman/robin/foo.spec.js' ) . should . equal ( false )
194
+ e . shouldInstrument ( 'src/batman/robin/foo.js' ) . should . equal ( true )
195
+ } )
186
196
} )
You can’t perform that action at this time.
0 commit comments