File tree 1 file changed +18
-0
lines changed
packages/jest-config/src/__tests__
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import * as path from 'path';
11
11
import semver = require( 'semver' ) ;
12
12
import type { Config } from '@jest/types' ;
13
13
import { escapeStrForRegex } from 'jest-regex-util' ;
14
+ import { requireOrImportModule } from 'jest-util' ;
14
15
import Defaults from '../Defaults' ;
15
16
import { DEFAULT_JS_PATTERN } from '../constants' ;
16
17
import normalize , { type AllOptions } from '../normalize' ;
26
27
...realFs ,
27
28
statSync : ( ) => ( { isDirectory : ( ) => true } ) ,
28
29
} ;
30
+ } )
31
+ . mock ( 'jest-util' , ( ) => {
32
+ const realUtil =
33
+ jest . requireActual < typeof import ( 'jest-util' ) > ( 'jest-util' ) ;
34
+
35
+ return {
36
+ ...realUtil ,
37
+ requireOrImportModule : ( filePath : string , interop = true ) => {
38
+ const result = require ( filePath ) ;
39
+
40
+ if ( interop ) {
41
+ return realUtil . interopRequireDefault ( result ) . default ;
42
+ }
43
+
44
+ return result ;
45
+ } ,
46
+ } ;
29
47
} ) ;
30
48
31
49
let root : string ;
You can’t perform that action at this time.
0 commit comments