https://kotlinlang.org logo
#kotest
Title
# kotest
n

nelson ramirez

02/09/2022, 4:32 PM
Hi, is the Robolectric kotest extension abandoned?
s

sam

02/09/2022, 4:33 PM
I would say if @LeoColman is not maintaining it anymore, than yeah. We need someone from the community to step up.
👍 1
n

nelson ramirez

02/09/2022, 4:35 PM
Thanks @sam
l

LeoColman

02/09/2022, 4:37 PM
I'm not. Robolectric was too much to me
n

nelson ramirez

02/09/2022, 4:41 PM
Thanks @LeoColman, Getting robolectric to work well with junit5 is already difficult on it's own. I appreciate your effort!
w

wasyl

02/09/2022, 4:41 PM
I’d say it’s pretty much impossible to have proper Robolectric support in JUnit5 right now: on one hand Robolectric only provides APIs for JUnit4, on the other JUnit5 doesn’t expose hooks for manipulating classpath for tests. So for now vintage runner + Robolectric rule is the only sane approach
s

sam

02/09/2022, 4:41 PM
@LeoColman would you mind updating the repo to add a note to this effect and mark the repo as archived ?
👍 1
w

wasyl

02/09/2022, 4:42 PM
(the only better alternative is to ditch Robolectric completely)
n

nelson ramirez

02/09/2022, 4:42 PM
I almost go things working yesterday, but ran into some MainLooper issues.
thanks @wasyl, Could you please expand on vintage runner + Robolectric rule as the only sane approach?
w

wasyl

02/09/2022, 4:45 PM
It’s just the only officially supported way to run Robolectric. I was mistaken about the rule, I meant
@RunWith(AndroidJUnit4::class)
annotation for tests and writing oldschool
@org.junit.Test
tests
and if you use JUnit5 in the project, you can do that by using vintage engine I think
n

nelson ramirez

02/09/2022, 4:45 PM
Thanks, that's exactly the setup i currently have
s

sam

02/09/2022, 4:45 PM
vintage engine allows you to run junit4 via junit platform yeah
n

nelson ramirez

02/09/2022, 4:46 PM
and I wish there was a better alternative to robolectric for running android tests on a jvm, but alas. we work with the hand we're dealt
I appreciate the help fellas! have a good one
👍🏻 1
16 Views