I'm writing Compose tests for one of my projects t...
# compose
l
I'm writing Compose tests for one of my projects that I recently started. I'm getting an ExceptionInInitializerError that is
caused by java.lang.RuntimeException: Method allowThreadDiskReads in android.os.StrictMode not mocked
. I wrote a simple test (in thread), which reproduced the issue. This only started when I added Compose tests.
class TestClass {
@get:Rule
val composetestRule = createComposeRule()
@Test
fun simpleTest() {
composeTestRule.setContent {
Text(text = "")
}
}
}
I'm using compose 1.0.1, junit 4.13.2, and kotlin("test-junit") in my build.gradle
The stacktrace points to the setContent line
a
Are you putting the test in "androidTest" directory?
l
I am
This is a KMM project if that matters
232 Views