File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 5
5
import path from 'path' ;
6
6
import { createBlacklist } from 'metro' ;
7
7
import { loadConfig } from 'metro-config' ;
8
+ import { existsSync } from 'fs' ;
8
9
import { type ConfigT } from 'types' ;
9
10
import findSymlinkedModules from './findSymlinkedModules' ;
10
11
@@ -31,13 +32,16 @@ const getBlacklistRE = () => createBlacklist([/.*\/__fixtures__\/.*/]);
31
32
* Otherwise, a.native.js will not load on Windows or other platforms
32
33
*/
33
34
export const getDefaultConfig = ( ctx : ConfigT ) => {
35
+ const hasteImplPath = path . join ( ctx . reactNativePath , 'jest/hasteImpl' ) ;
34
36
return {
35
37
resolver : {
36
38
resolverMainFields : [ 'react-native' , 'browser' , 'main' ] ,
37
39
blacklistRE : getBlacklistRE ( ) ,
38
40
platforms : [ ...ctx . haste . platforms , 'native' ] ,
39
41
providesModuleNodeModules : ctx . haste . providesModuleNodeModules ,
40
- hasteImplModulePath : path . join ( ctx . reactNativePath , 'jest/hasteImpl' ) ,
42
+ hasteImplModulePath : existsSync ( hasteImplPath )
43
+ ? hasteImplPath
44
+ : undefined ,
41
45
} ,
42
46
serializer : {
43
47
getModulesRunBeforeMainModule : ( ) => [
You can’t perform that action at this time.
0 commit comments