From 11829676be0407f4422bf3e1a03a81fb4e629790 Mon Sep 17 00:00:00 2001 From: d4vidi Date: Tue, 9 May 2023 18:27:24 +0300 Subject: [PATCH] Androidx.test core 1.5.0 (#4046) --- detox/android/detox/build.gradle | 6 +++--- detox/package.json | 2 ++ detox/test/e2e/19.crash-handling.test.js | 5 ++--- scripts/ci.android.sh | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/detox/android/detox/build.gradle b/detox/android/detox/build.gradle index 8cedb49518..e57d6c9525 100644 --- a/detox/android/detox/build.gradle +++ b/detox/android/detox/build.gradle @@ -102,10 +102,10 @@ dependencies { api('org.hamcrest:hamcrest:2.2') { because 'See https://github.com/wix/Detox/issues/3920. Need to force hamcrest 2.2 win in battle of 2.2 vs. 1.3 (specified by Espresso).' } - api('androidx.test:rules:1.4.0') { + api('androidx.test:rules:1.5.0') { because 'of ActivityTestRule. Needed by users *and* internally used by Detox.' } - api('androidx.test.ext:junit:1.1.3') { + api('androidx.test.ext:junit:1.1.5') { because 'Needed so as to seamlessly provide AndroidJUnit4 to Detox users. Depends on junit core.' } @@ -136,7 +136,7 @@ dependencies { testImplementation 'org.json:json:20140107' // https://github.com/spekframework/spek/issues/232#issuecomment-610732158 - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.6.0' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.2' testImplementation 'org.assertj:assertj-core:3.16.1' testImplementation "org.jetbrains.kotlin:kotlin-test:$_kotlinVersion" diff --git a/detox/package.json b/detox/package.json index 9a2f6652f5..de836c3583 100644 --- a/detox/package.json +++ b/detox/package.json @@ -24,6 +24,8 @@ "build:android-native": "cd android && ./gradlew publish -Dversion=999.999.999 -DbuildFlavour=coreNative -DforceLocal=true && cd ..", "lint": "eslint .", "unit": "jest --coverage --verbose", + "unit:android-debug": "cd android && ./gradlew testFullDebug", + "unit:android-release": "cd android && ./gradlew testFullRelease", "pretest": "npm run lint", "test": "npm run unit", "posttest": "cp coverage/lcov.info coverage/unit.lcov", diff --git a/detox/test/e2e/19.crash-handling.test.js b/detox/test/e2e/19.crash-handling.test.js index 331dec00df..1912538afa 100644 --- a/detox/test/e2e/19.crash-handling.test.js +++ b/detox/test/e2e/19.crash-handling.test.js @@ -56,8 +56,7 @@ describe('Crash Handling', () => { // It's important that the native-error message (containing the native stack-trace) would also // be included in the error's stack property, in order for Jest (specifically) to properly output all // of that into the shell, as we expect it to. - jestExpect(error.stack).toContain('Native stacktrace dump:\njava.lang.RuntimeException:'); - jestExpect(error.stack).toContain('\tat android.app'); - jestExpect(error.stack).toContain('Caused by: java.lang.IllegalStateException: This is an intentional crash!'); + jestExpect(error.stack).toContain('Native stacktrace dump:\njava.lang.IllegalStateException: This is an intentional crash!'); + jestExpect(error.stack).toContain('\tat com.example.CrashingActivity.onResume'); }, 60000); }); diff --git a/scripts/ci.android.sh b/scripts/ci.android.sh index 1bb01db7db..6aca792839 100755 --- a/scripts/ci.android.sh +++ b/scripts/ci.android.sh @@ -20,7 +20,7 @@ popd if [[ $currentRnVersion -ge 66 ]]; then pushd detox/android - run_f "./gradlew testFullRelease" + run_f "npm run unit:android-release" popd else echo "Skipping Android unit tests (react-native version ${currentRnVersion} is not ≥66)"