mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use Hermes for RN instrumentation tests
Summary: make ReactTestHelper always return a test object set to use Hermes. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D19566604 fbshipit-source-id: 3c8fc680afbae000adb96bfcd079104d86cf06bd
This commit is contained in:
committed by
Facebook Github Bot
parent
674ac69cee
commit
316b470b7f
@@ -14,6 +14,7 @@ rn_android_library(
|
||||
"PUBLIC",
|
||||
],
|
||||
deps = [
|
||||
react_native_dep("java/com/facebook/hermes/reactexecutor:reactexecutor"),
|
||||
react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"),
|
||||
react_native_dep("third-party/android/androidx:annotation"),
|
||||
react_native_dep("third-party/android/androidx:core"),
|
||||
@@ -33,7 +34,6 @@ rn_android_library(
|
||||
react_native_target("java/com/facebook/react/common:common"),
|
||||
react_native_target("java/com/facebook/react/devsupport:interfaces"),
|
||||
react_native_target("java/com/facebook/react/fabric:fabric"),
|
||||
react_native_target("java/com/facebook/react/jscexecutor:jscexecutor"),
|
||||
react_native_target("java/com/facebook/react/module/annotations:annotations"),
|
||||
react_native_target("java/com/facebook/react/module/model:model"),
|
||||
react_native_target("java/com/facebook/react/modules/core:core"),
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.view.ViewGroup;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import com.android.internal.util.Predicate;
|
||||
import com.facebook.hermes.reactexecutor.HermesExecutorFactory;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.NativeModuleRegistryBuilder;
|
||||
import com.facebook.react.R;
|
||||
@@ -28,7 +29,6 @@ import com.facebook.react.bridge.NativeModule;
|
||||
import com.facebook.react.bridge.NativeModuleCallExceptionHandler;
|
||||
import com.facebook.react.bridge.ReactApplicationContext;
|
||||
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;
|
||||
import com.facebook.react.jscexecutor.JSCExecutorFactory;
|
||||
import com.facebook.react.modules.core.ReactChoreographer;
|
||||
import com.facebook.react.uimanager.ViewManager;
|
||||
import java.util.Arrays;
|
||||
@@ -79,7 +79,7 @@ public class ReactTestHelper {
|
||||
}
|
||||
JavaScriptExecutor executor = null;
|
||||
try {
|
||||
executor = new JSCExecutorFactory("ReactTestHelperApp", "ReactTestHelperDevice").create();
|
||||
executor = new HermesExecutorFactory().create();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -108,7 +108,8 @@ public class ReactTestHelper {
|
||||
|
||||
@Override
|
||||
public ReactInstanceManagerBuilder getReactInstanceManagerBuilder() {
|
||||
return ReactInstanceManager.builder();
|
||||
return ReactInstanceManager.builder()
|
||||
.setJavaScriptExecutorFactory(new HermesExecutorFactory());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user