Fix misleading filepaths for DetoxTest.java in project-setup.mdx #4287
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In this pull request, I have fixed misleading filepaths in the documentation for Project Setup in Step 4: Additional Android configuration.
The issue with the misleading documentation lines are that they referenced the test code will reside at
android/app/src/androidTest/java/com/<you.package>/DetoxTest.java
however this is incorrect as it should instead reside atandroid/app/src/androidTest/java/DetoxTest.java
.I spent 2 hours debugging an issue where Detox would build and attempt to run the test however it would not launch the app and would fail at
await device.launchApp()
:11-21 17:08:25.517 20209 20209 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
adb ... shell am instrument
command returningOK (0 tests)
:DetoxTest.java
DetoxTest.java
in my source sets until I found thatandroidTest/java/DetoxTest.java
was the working pathSince I have fixed this issue after 2 hours of debugging I think it warrants the docs to be updated since two simple line changes would have saved me 2 hours.
Note: This solution is working for me with the following combinations:
"react-native": "0.70.5",
"detox": "^20.13.5",
targetSdkVersion = 32
kotlinVersion = '1.7.0'
productFlavors
buildTypes
:debug
andrelease