Skip to content

Commit

Permalink
Enable Androidx Espresso(+contrib) for unit testing
Browse files Browse the repository at this point in the history
Espresso is supported by Robolectric(https://robolectric.org/androidx_test/)
and it provides a better API to work with the view hierarchy in tests.
  • Loading branch information
lukstbit authored and david-allison committed Feb 7, 2024
1 parent af40ad4 commit 936933a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AnkiDroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,12 @@ dependencies {
// in a JvmTest we need org.json.JSONObject to not be mocked
testImplementation 'org.json:json:20231013'
testImplementation 'io.github.ivanshafran:shared-preferences-mock:1.2.4'
testImplementation "androidx.test:runner:$androidx_test_version"
testImplementation "androidx.test:rules:$androidx_test_version"
testImplementation "androidx.test.espresso:espresso-core:$espresso_version"
testImplementation("androidx.test.espresso:espresso-contrib:$espresso_version") {
exclude module: "protobuf-lite"
}

androidTestImplementation project(':testlib')

Expand Down

0 comments on commit 936933a

Please sign in to comment.