Skip to main content
Version: 5.2

Robolectric

Robolectric​

Latest Release

Robolectric can be used with Kotest through the RobolectricExtension which can be found in a separate repository,kotest-extensions-robolectric

To add this module to project you need specify following in your build.gradle:

testImplementation("io.kotest.extensions:kotest-extensions-robolectric:${version}")

This dependency brings in RobolectricExtension, which is autoregistered to your projects.

Now all you need to do is annotate Robolectric specs with @RobolectricTest and you're set!

@RobolectricTest
class MyTest : ShouldSpec({
should("Access Robolectric normally!") {

}
})