@@ -14,7 +14,12 @@ import {statSync} from 'graceful-fs';
14
14
import micromatch = require( 'micromatch' ) ;
15
15
import type { Config } from '@jest/types' ;
16
16
import { replacePathSepForRegex } from 'jest-regex-util' ;
17
- import Resolver from 'jest-resolve' ;
17
+ import Resolver , {
18
+ resolveRunner ,
19
+ resolveSequencer ,
20
+ resolveTestEnvironment ,
21
+ resolveWatchPlugin ,
22
+ } from 'jest-resolve' ;
18
23
import {
19
24
clearLine ,
20
25
replacePathSepForGlob ,
@@ -35,14 +40,11 @@ import {
35
40
DOCUMENTATION_NOTE ,
36
41
_replaceRootDirTags ,
37
42
escapeGlobCharacters ,
38
- getRunner ,
39
- getSequencer ,
40
- getTestEnvironment ,
41
- getWatchPlugin ,
42
43
replaceRootDirInPath ,
43
44
resolve ,
44
45
} from './utils' ;
45
46
import validatePattern from './validatePattern' ;
47
+
46
48
const ERROR = `${ BULLET } Validation Error` ;
47
49
const PRESET_EXTENSIONS = [ '.json' , '.js' , '.cjs' , '.mjs' ] ;
48
50
const PRESET_NAME = 'jest-preset' ;
@@ -604,7 +606,7 @@ export default async function normalize(
604
606
options . setupFilesAfterEnv . push ( options . setupTestFrameworkScriptFile ) ;
605
607
}
606
608
607
- options . testEnvironment = getTestEnvironment ( {
609
+ options . testEnvironment = resolveTestEnvironment ( {
608
610
rootDir : options . rootDir ,
609
611
testEnvironment : options . testEnvironment || DEFAULT_CONFIG . testEnvironment ,
610
612
} ) ;
@@ -739,7 +741,7 @@ export default async function normalize(
739
741
const option = oldOptions [ key ] ;
740
742
value =
741
743
option &&
742
- getRunner ( newOptions . resolver , {
744
+ resolveRunner ( newOptions . resolver , {
743
745
filePath : option ,
744
746
rootDir : options . rootDir ,
745
747
} ) ;
@@ -1010,15 +1012,15 @@ export default async function normalize(
1010
1012
if ( typeof watchPlugin === 'string' ) {
1011
1013
return {
1012
1014
config : { } ,
1013
- path : getWatchPlugin ( newOptions . resolver , {
1015
+ path : resolveWatchPlugin ( newOptions . resolver , {
1014
1016
filePath : watchPlugin ,
1015
1017
rootDir : options . rootDir ,
1016
1018
} ) ,
1017
1019
} ;
1018
1020
} else {
1019
1021
return {
1020
1022
config : watchPlugin [ 1 ] || { } ,
1021
- path : getWatchPlugin ( newOptions . resolver , {
1023
+ path : resolveWatchPlugin ( newOptions . resolver , {
1022
1024
filePath : watchPlugin [ 0 ] ,
1023
1025
rootDir : options . rootDir ,
1024
1026
} ) ,
@@ -1051,7 +1053,7 @@ export default async function normalize(
1051
1053
// ignored
1052
1054
}
1053
1055
1054
- newOptions . testSequencer = getSequencer ( newOptions . resolver , {
1056
+ newOptions . testSequencer = resolveSequencer ( newOptions . resolver , {
1055
1057
filePath : options . testSequencer || DEFAULT_CONFIG . testSequencer ,
1056
1058
rootDir : options . rootDir ,
1057
1059
} ) ;
0 commit comments