-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to run junit5 tests with robolectric? #305
Comments
The short answer is no.
The way Robolectric injects the modified version of the That being said, a recent version upgrade of JUnit 5 has introduced the ability for custom class loading. If you want to dive into the lengthy discussion, the ticket is here. With this merged, it's theoretically possible to port over Robolectric's old code to a JUnit 5 extension – the main problem is, nobody was able to dedicate time to it just yet. The Robolectric feature ticket to support JUnit 5 is here and I'm crossing my fingers that we will see a Robolectric extension in the future! Until then, please stick to (I'm going to pin this issue for visibility since this question does come up every once in a while. Hope you don't mind!) |
@mannodermaus thank you for the answer |
People, is it possible to run Robolectric with vintage engine? |
@emartynov It is! If you annotate your Robolectric tests with the JUnit 4 annotations (i.e. |
Some new developments are spinning up in this space! First, @warnyul the absolute GOAT has started publicizing an interop plugin to bridge the gap between Robolectric and JUnit 5. Essentially, it is possible to run those tests on the JUnit Platform now! YMMV, but my first impression is very good. Show him some love by starring it! Second, Robolectric is participating in Google Summer of Code 2024. One of the suggested projects in their pitch deck deals with the refactoring of Robolectric to support JUnit 5! Of course, this is a much more long-term undertaking, but I'm delighted to see that they are starting to throw the idea of evolution out there. 😊 |
I see that RobolectricTestRunner is based in junit4 runner and i have initialization error
The text was updated successfully, but these errors were encountered: