File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
### Fixes
14
14
15
+ - ` [jest-config] ` ` require.resolve ` on default test sequencer and test environment ([ #11482 ] ( https://github.com/facebook/jest/pull/11482 ) )
15
16
- ` [jest-mock] ` Fixed ` fn ` and ` spyOn ` exports ([ #11480 ] ( https://github.com/facebook/jest/pull/11480 ) )
16
17
17
18
## 27.0.2
Original file line number Diff line number Diff line change @@ -754,6 +754,19 @@ describe('testEnvironment', () => {
754
754
) ;
755
755
} ) ;
756
756
757
+ it ( 'resolves to node environment by default' , async ( ) => {
758
+ const { options} = await normalize (
759
+ {
760
+ rootDir : '/root' ,
761
+ } ,
762
+ { } as Config . Argv ,
763
+ ) ;
764
+
765
+ expect ( options . testEnvironment ) . toEqual (
766
+ require . resolve ( 'jest-environment-node' ) ,
767
+ ) ;
768
+ } ) ;
769
+
757
770
it ( 'throws on invalid environment names' , async ( ) => {
758
771
await expect (
759
772
normalize (
Original file line number Diff line number Diff line change @@ -608,7 +608,9 @@ export default async function normalize(
608
608
609
609
options . testEnvironment = resolveTestEnvironment ( {
610
610
rootDir : options . rootDir ,
611
- testEnvironment : options . testEnvironment || DEFAULT_CONFIG . testEnvironment ,
611
+ testEnvironment :
612
+ options . testEnvironment ||
613
+ require . resolve ( DEFAULT_CONFIG . testEnvironment ) ,
612
614
} ) ;
613
615
614
616
if ( ! options . roots && options . testPathDirs ) {
@@ -1054,7 +1056,8 @@ export default async function normalize(
1054
1056
}
1055
1057
1056
1058
newOptions . testSequencer = resolveSequencer ( newOptions . resolver , {
1057
- filePath : options . testSequencer || DEFAULT_CONFIG . testSequencer ,
1059
+ filePath :
1060
+ options . testSequencer || require . resolve ( DEFAULT_CONFIG . testSequencer ) ,
1058
1061
rootDir : options . rootDir ,
1059
1062
} ) ;
1060
1063
You can’t perform that action at this time.
0 commit comments