@@ -51,15 +51,15 @@ const getDependencyModules = (testAppPath) => {
51
51
reactNativeModules : {
52
52
corePath : reactNativePath ,
53
53
initializeCorePath : require . resolve ( path . join ( reactNativePath , 'Libraries' , 'Core' , 'InitializeCore' ) ) ,
54
- cliServerApi : require ( path . join ( testAppModulesPath , '@react-native-community/ cli-server-api' ) ) ,
54
+ cliServerApi : require ( path . join ( testAppModulesPath , '@react-native-community' , ' cli-server-api') ) ,
55
55
getPolyfills : require ( path . join ( reactNativePath , 'rn-get-polyfills' ) ) ,
56
56
} ,
57
57
testAppModulesPath,
58
58
} ;
59
59
} ;
60
60
61
- const resolveModule = ( moduleName , testAppModulesPath ) => {
62
- if ( moduleName === './index' ) {
61
+ const resolveModule = ( context , moduleName , testAppModulesPath ) => {
62
+ if ( moduleName === './index' && context . originModulePath . endsWith ( 'react-native-test-runner/.' ) ) {
63
63
return './app/index' ;
64
64
}
65
65
@@ -106,7 +106,7 @@ const getMetroConfig = ({ cwd = process.cwd(), testFileGlobs, port = 8081, testA
106
106
resolverMainFields : [ 'react-native' , 'browser' , 'main' ] ,
107
107
platforms : [ 'ios' , 'android' , 'native' ] ,
108
108
resolveRequest : ( context , realModuleName , platform , moduleName ) => {
109
- moduleName = resolveModule ( moduleName , testAppModulesPath ) ;
109
+ moduleName = resolveModule ( context , moduleName , testAppModulesPath ) ;
110
110
111
111
const originalResolveRequest = context . resolveRequest ;
112
112
0 commit comments