File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1313
1414- ` [*] ` Replace ` any ` s with ` unknown ` s ([ #9626 ] ( https://github.com/facebook/jest/pull/9626 ) )
1515- ` [@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 ) )
1617
1718### Performance
1819
Original file line number Diff line number Diff line change @@ -40,8 +40,9 @@ export type TestSelectionConfig = {
4040const globsToMatcher = ( globs : Array < Config . Glob > ) => ( path : Config . Path ) =>
4141 micromatch ( [ replacePathSepForGlob ( path ) ] , globs , { dot : true } ) . length > 0 ;
4242
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 ) ) ;
4546
4647const toTests = ( context : Context , tests : Array < Config . Path > ) =>
4748 tests . map ( path => ( {
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ export type ProjectConfig = {
345345 testMatch : Array < Glob > ;
346346 testLocationInResults : boolean ;
347347 testPathIgnorePatterns : Array < string > ;
348- testRegex : Array < string > ;
348+ testRegex : Array < string | RegExp > ;
349349 testRunner : string ;
350350 testURL : string ;
351351 timers : 'real' | 'fake' ;
You can’t perform that action at this time.
0 commit comments