File tree 3 files changed +5
-3
lines changed
3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 13
13
14
14
- ` [*] ` Replace ` any ` s with ` unknown ` s ([ #9626 ] ( https://github.com/facebook/jest/pull/9626 ) )
15
15
- ` [@jest/transform] ` Expose type ` CacheKeyOptions ` for ` getCacheKey ` ([ #9762 ] ( https://github.com/facebook/jest/pull/9762 ) )
16
+ - ` [@jest/types] ` Correct type ` testRegex ` for ` ProjectConfig ` ([ #9780 ] ( https://github.com/facebook/jest/pull/9780 ) )
16
17
17
18
### Performance
18
19
Original file line number Diff line number Diff line change @@ -40,8 +40,9 @@ export type TestSelectionConfig = {
40
40
const globsToMatcher = ( globs : Array < Config . Glob > ) => ( path : Config . Path ) =>
41
41
micromatch ( [ replacePathSepForGlob ( path ) ] , globs , { dot : true } ) . length > 0 ;
42
42
43
- const regexToMatcher = ( testRegex : Array < string > ) => ( path : Config . Path ) =>
44
- testRegex . some ( testRegex => new RegExp ( testRegex ) . test ( path ) ) ;
43
+ const regexToMatcher = ( testRegex : Config . ProjectConfig [ 'testRegex' ] ) => (
44
+ path : Config . Path ,
45
+ ) => testRegex . some ( testRegex => new RegExp ( testRegex ) . test ( path ) ) ;
45
46
46
47
const toTests = ( context : Context , tests : Array < Config . Path > ) =>
47
48
tests . map ( path => ( {
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ export type ProjectConfig = {
345
345
testMatch : Array < Glob > ;
346
346
testLocationInResults : boolean ;
347
347
testPathIgnorePatterns : Array < string > ;
348
- testRegex : Array < string > ;
348
+ testRegex : Array < string | RegExp > ;
349
349
testRunner : string ;
350
350
testURL : string ;
351
351
timers : 'real' | 'fake' ;
You can’t perform that action at this time.
0 commit comments