Skip to content

Commit e0a22ec

Browse files
committed
update kotest to JUnit 5 in testhelpers
Robolectric only has a JUnit 4 interface, however we are adapting it via RobolectricExtension.kt. However this means we still require a reference to JUnit4 in this specific testhelpers to do this.
1 parent 727e3bc commit e0a22ec

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

OneSignalSDK/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ buildscript {
1717
kotestVersion = '5.8.0'
1818
ktlintPluginVersion = '11.6.1'
1919
ktlintVersion = '1.0.1'
20-
junitVersion = '4.13.2'
2120
// DO NOT upgrade for tests, using an old version so it matches AOSP
2221
tdunningJsonForTest = '1.0'
2322
}

OneSignalSDK/onesignal/testhelpers/build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ android {
3838
dependencies {
3939
implementation(project(':OneSignal:core'))
4040

41-
implementation("junit:junit:$junitVersion")
42-
implementation("io.kotest:kotest-runner-junit4:$kotestVersion")
41+
// Only use for RobolectricExtension.kt,
42+
// to bridge Robolectric's JUnit4 usage to Kotest's Junit 5
43+
implementation("junit:junit:4.13.2")
44+
45+
implementation("io.kotest:kotest-runner-junit5:$kotestVersion")
46+
implementation("io.kotest:kotest-runner-junit5-jvm:$kotestVersion")
4347
implementation("org.robolectric:robolectric:4.8.1")
4448
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
4549
implementation("io.mockk:mockk:1.13.2")

0 commit comments

Comments
 (0)