mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 17:42:24 +08:00
tests: use Detox as compile reference, ignore UIManager queues (#4076)
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
// Add the Firebase Crashlytics plugin.
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.firebase.crashlytics'
|
||||
|
||||
|
||||
|
||||
|
||||
apply plugin: "com.google.firebase.firebase-perf"
|
||||
|
||||
|
||||
import com.android.build.OutputFile
|
||||
|
||||
project.ext.react = [
|
||||
@@ -140,7 +133,7 @@ dependencies {
|
||||
/* ------------------------
|
||||
* TESTING SDKS/LIBRARIES
|
||||
* ------------------------ */
|
||||
androidTestImplementation('com.wix:detox:+')
|
||||
androidTestImplementation(project(path: ":detox"))
|
||||
}
|
||||
|
||||
// Run this once to be able to run the application with BUCK
|
||||
|
||||
@@ -29,10 +29,10 @@ allprojects {
|
||||
// Android JSC is installed from npm
|
||||
url("$rootDir/../node_modules/jsc-android/dist")
|
||||
}
|
||||
maven {
|
||||
// Detox
|
||||
url "$rootDir/../node_modules/detox/Detox-android"
|
||||
}
|
||||
// maven {
|
||||
// // Detox as an .aar file (we're going to use it as a compile dependency though, to patch it)
|
||||
// url "$rootDir/../node_modules/detox/Detox-android"
|
||||
// }
|
||||
jcenter()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
rootProject.name = '@react-native-firebase_tests'
|
||||
|
||||
include ':detox'
|
||||
project(':detox').projectDir = new File(rootProject.projectDir, '../node_modules/detox/android/detox')
|
||||
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
|
||||
include ':app'
|
||||
|
||||
29
tests/patches/detox+16.7.2.patch
Normal file
29
tests/patches/detox+16.7.2.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
diff --git a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
|
||||
index 181233a..f834f6b 100644
|
||||
--- a/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
|
||||
+++ b/node_modules/detox/android/detox/src/main/java/com/wix/detox/reactnative/idlingresources/UIModuleIdlingResource.java
|
||||
@@ -100,18 +100,21 @@ public class UIModuleIdlingResource implements IdlingResource, Choreographer.Fra
|
||||
}
|
||||
|
||||
boolean isOperationQueueEmpty = (Boolean) Reflect.on(uiOperationQueue).call(METHOD_IS_EMPTY).get();
|
||||
+ Log.d(LOG_TAG, "UIManagerModule queue status: runnables? / nonBatchesOps? / operationQueue? - " + runnablesAreEmpty + " / " + nonBatchesOpsEmpty + " / " + isOperationQueueEmpty);
|
||||
|
||||
if (runnablesAreEmpty && nonBatchesOpsEmpty && isOperationQueueEmpty) {
|
||||
if (callback != null) {
|
||||
callback.onTransitionToIdle();
|
||||
}
|
||||
- // Log.i(LOG_TAG, "UIManagerModule is idle.");
|
||||
+ Log.d(LOG_TAG, "UIManagerModule is idle.");
|
||||
return true;
|
||||
}
|
||||
|
||||
Log.i(LOG_TAG, "UIManagerModule is busy.");
|
||||
- Choreographer.getInstance().postFrameCallback(this);
|
||||
- return false;
|
||||
+ Log.w(LOG_TAG, "UIManagerModule is busy but damn the torpedoes!");
|
||||
+ return true;
|
||||
+ // Choreographer.getInstance().postFrameCallback(this);
|
||||
+ // return false;
|
||||
} catch (ReflectException e) {
|
||||
Log.e(LOG_TAG, "Can't set up RN UIModule listener", e.getCause());
|
||||
}
|
||||
Reference in New Issue
Block a user