Hi, I am using ExpectSpec framework in Android. I ...
# kotest
d
Hi, I am using ExpectSpec framework in Android. I try to use
@RobolectoricTest
.
Copy code
@RobolectricTest
class ChannelFragmentKotest : ExpectSpec({
But, I cannot solve below error… 😞 Anyone can help me?!
Copy code
No instrumentation registered! Must run under a registering instrumentation.
java.lang.IllegalStateException: No instrumentation registered! Must run under a registering instrumentation.
s
Roboelectric doesn't work well outside of junit
👍 2
d
@sam Thank you! But, I didn’t understand the meaning of
outside of junit
. AFAIK,
ExpectSpec
is also worked in
junit5
. In this doc, https://kotest.io/docs/5.2/extensions/robolectric.html
ShouldSpec
is supported by
Robolectric
. Is the doc wrong?!
l
That's for version 5.2, and it was always experimental. We decided to drop support of Robolectric after their update broke our integration and we had no core developers able to maintain it
We unfortunately stopped releasing versions compatible with Robolectric a couple of majors ago. However, if version 0.5.0 of the extension was working for you, it's still published and should work again
I do like Android tho, and have kept some of the matchers and runner (not robolectric) available at https://github.com/LeoColman/kotest-android if you're interested
I didn’t understand the meaning of
outside of junit
Outside of JUnit means Kotest. Kotest is not JUnit eventhough we keep some integration with JUnit 5 and JUnit 4 Robolectric is very hardcoded for JUnit, which means it's very hard to integrate with Kotest.
👀 1
d
Thank you!