- Add androidUnitTest source set: JUnit 4, Robolectric 4.14.1, mockk, androidx.test - Add androidInstrumentedTest source set: androidx.test.ext, espresso, mockk-android - Pin Robolectric to SDK 34 (Robolectric 4.14.1 doesn't yet support compileSdk 36) - Enable includeAndroidResources for Robolectric - Canary tests green on both source sets Verifies: ./gradlew :composeApp:testDebugUnitTest ./gradlew :composeApp:compileDebugAndroidTestSources Part of Android -> iOS parity plan (rc-android-ios-parity.md). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18 lines
500 B
Kotlin
18 lines
500 B
Kotlin
package com.tt.honeyDue
|
|
|
|
import androidx.test.core.app.ApplicationProvider
|
|
import androidx.test.ext.junit.runners.AndroidJUnit4
|
|
import org.junit.Assert.assertTrue
|
|
import org.junit.Test
|
|
import org.junit.runner.RunWith
|
|
|
|
@RunWith(AndroidJUnit4::class)
|
|
class CanaryInstrumentedTest {
|
|
|
|
@Test
|
|
fun app_context_available() {
|
|
val appContext = ApplicationProvider.getApplicationContext<android.content.Context>()
|
|
assertTrue(appContext.packageName.startsWith("com.tt.honeyDue"))
|
|
}
|
|
}
|