File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1212
1313### Fixes
1414
15+ - ` [jest-config] ` ` require.resolve ` on default test sequencer and test environment ([ #11482 ] ( https://github.com/facebook/jest/pull/11482 ) )
1516- ` [jest-mock] ` Fixed ` fn ` and ` spyOn ` exports ([ #11480 ] ( https://github.com/facebook/jest/pull/11480 ) )
1617
1718## 27.0.2
Original file line number Diff line number Diff line change @@ -754,6 +754,19 @@ describe('testEnvironment', () => {
754754 ) ;
755755 } ) ;
756756
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+
757770 it ( 'throws on invalid environment names' , async ( ) => {
758771 await expect (
759772 normalize (
Original file line number Diff line number Diff line change @@ -608,7 +608,9 @@ export default async function normalize(
608608
609609 options . testEnvironment = resolveTestEnvironment ( {
610610 rootDir : options . rootDir ,
611- testEnvironment : options . testEnvironment || DEFAULT_CONFIG . testEnvironment ,
611+ testEnvironment :
612+ options . testEnvironment ||
613+ require . resolve ( DEFAULT_CONFIG . testEnvironment ) ,
612614 } ) ;
613615
614616 if ( ! options . roots && options . testPathDirs ) {
@@ -1054,7 +1056,8 @@ export default async function normalize(
10541056 }
10551057
10561058 newOptions . testSequencer = resolveSequencer ( newOptions . resolver , {
1057- filePath : options . testSequencer || DEFAULT_CONFIG . testSequencer ,
1059+ filePath :
1060+ options . testSequencer || require . resolve ( DEFAULT_CONFIG . testSequencer ) ,
10581061 rootDir : options . rootDir ,
10591062 } ) ;
10601063
You can’t perform that action at this time.
0 commit comments